Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for browser devtools option #868

Merged
merged 1 commit into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions chromium/browser_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,10 @@ func prepareFlags(lopts *common.LaunchOptions, k6opts *k6lib.Options) (map[strin
"use-mock-keychain": true,
"no-service-autorun": true,

"no-startup-window": true,
"no-default-browser-check": true,
"headless": lopts.Headless,
"auto-open-devtools-for-tabs": lopts.Devtools,
"window-size": fmt.Sprintf("%d,%d", 800, 600),
"no-startup-window": true,
"no-default-browser-check": true,
"headless": lopts.Headless,
"window-size": fmt.Sprintf("%d,%d", 800, 600),
}
if lopts.Headless {
f["hide-scrollbars"] = true
Expand Down
6 changes: 0 additions & 6 deletions chromium/browser_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ func TestBrowserTypePrepareFlags(t *testing.T) {
expInitVal, expChangedVal any
post func(t *testing.T, flags map[string]any)
}{
{
flag: "auto-open-devtools-for-tabs",
expInitVal: false,
changeOpts: &common.LaunchOptions{Devtools: true},
expChangedVal: true,
},
{
flag: "hide-scrollbars",
changeOpts: &common.LaunchOptions{IgnoreDefaultArgs: []string{"hide-scrollbars"}, Headless: true},
Expand Down
5 changes: 0 additions & 5 deletions common/browser_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
const (
optArgs = "args"
optDebug = "debug"
optDevTools = "devtools"
optEnv = "env"
optExecutablePath = "executablePath"
optHeadless = "headless"
Expand All @@ -36,7 +35,6 @@ type ProxyOptions struct {
type LaunchOptions struct {
Args []string
Debug bool
Devtools bool
Env map[string]string
ExecutablePath string
Headless bool
Expand Down Expand Up @@ -111,8 +109,6 @@ func (l *LaunchOptions) Parse(ctx context.Context, logger *log.Logger, opts goja
err = exportOpt(rt, k, v, &l.Args)
case optDebug:
l.Debug, err = parseBoolOpt(k, v)
case optDevTools:
l.Devtools, err = parseBoolOpt(k, v)
case optEnv:
err = exportOpt(rt, k, v, &l.Env)
case optExecutablePath:
Expand Down Expand Up @@ -145,7 +141,6 @@ func (l *LaunchOptions) shouldIgnoreIfBrowserIsRemote(opt string) bool {

shouldIgnoreIfBrowserIsRemote := map[string]struct{}{
optArgs: {},
optDevTools: {},
optEnv: {},
optExecutablePath: {},
optHeadless: {},
Expand Down
14 changes: 0 additions & 14 deletions common/browser_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ func TestBrowserLaunchOptionsParse(t *testing.T) {
opts: map[string]any{
// disallow changing the following opts
"args": []string{"any"},
"devtools": true,
"env": map[string]string{"some": "thing"},
"executablePath": "something else",
"headless": false,
Expand Down Expand Up @@ -120,19 +119,6 @@ func TestBrowserLaunchOptionsParse(t *testing.T) {
opts: map[string]any{"debug": "true"},
err: "debug should be a boolean",
},
"devtools": {
opts: map[string]any{
"devtools": true,
},
assert: func(tb testing.TB, lo *LaunchOptions) {
tb.Helper()
assert.True(t, lo.Devtools)
},
},
"devtools_err": {
opts: map[string]any{"devtools": "true"},
err: "devtools should be a boolean",
},
"env": {
opts: map[string]any{
"env": map[string]string{"key": "value"},
Expand Down