From 9d656a8ca02c72b84df27110d54d025b2639cf84 Mon Sep 17 00:00:00 2001 From: alexmos Date: Tue, 1 Dec 2015 18:03:09 -0800 Subject: Fix ExtensionApiTest.ContentScriptExtensionIframe for --isolate-extensions. This requires making the test aware of kIsolateExtensions, so that it can adjust its expectations accordingly. Since the schema in extensions/common/api/test.json is also used in extensions_browsertests (by web_view_apitest.cc), this also required moving kIsolateExtensions to a location where those tests can reference them, namely extensions/common/switches.cc. BUG=532666 Review URL: https://codereview.chromium.org/1457163002 Cr-Commit-Position: refs/heads/master@{#362580} --- .../browser/guest_view/web_view/web_view_apitest.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'extensions/browser/guest_view') diff --git a/extensions/browser/guest_view/web_view/web_view_apitest.cc b/extensions/browser/guest_view/web_view/web_view_apitest.cc index 378cafc..805fb9d 100644 --- a/extensions/browser/guest_view/web_view/web_view_apitest.cc +++ b/extensions/browser/guest_view/web_view/web_view_apitest.cc @@ -24,6 +24,7 @@ #include "extensions/browser/process_manager.h" #include "extensions/common/extension.h" #include "extensions/common/extension_paths.h" +#include "extensions/common/switches.h" #include "extensions/shell/browser/shell_content_browser_client.h" #include "extensions/shell/browser/shell_extension_system.h" #include "extensions/shell/test/shell_test.h" @@ -46,7 +47,7 @@ const char kUserAgentRedirectResponsePath[] = "/detect-user-agent"; const char kTestDataDirectory[] = "testDataDirectory"; const char kTestServerPort[] = "testServer.port"; const char kTestWebSocketPort[] = "testWebSocketPort"; -const char kSitePerProcess[] = "sitePerProcess"; +const char kIsolateExtensions[] = "isolateExtensions"; // Handles |request| by serving a redirect response if the |User-Agent| is // foobar. @@ -180,7 +181,7 @@ void WebViewAPITest::RunTestOnMainThreadLoop() { void WebViewAPITest::SetUpCommandLine(base::CommandLine* command_line) { AppShellTest::SetUpCommandLine(command_line); - command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); + command_line->AppendSwitchASCII(::switches::kJavaScriptFlags, "--expose-gc"); } void WebViewAPITest::SetUpOnMainThread() { @@ -189,9 +190,11 @@ void WebViewAPITest::SetUpOnMainThread() { TestGetConfigFunction::set_test_config_state(&test_config_); base::FilePath test_data_dir; test_config_.SetInteger(kTestWebSocketPort, 0); - test_config_.SetBoolean(kSitePerProcess, - base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kSitePerProcess)); + bool isolate_extensions = base::CommandLine::ForCurrentProcess()->HasSwitch( + ::switches::kSitePerProcess) || + base::CommandLine::ForCurrentProcess()->HasSwitch( + extensions::switches::kIsolateExtensions); + test_config_.SetBoolean(kIsolateExtensions, isolate_extensions); } void WebViewAPITest::StartTestServer() { @@ -278,7 +281,7 @@ void WebViewAPITest::SendMessageToGuestAndWait( void WebViewDPIAPITest::SetUp() { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, + command_line->AppendSwitchASCII(::switches::kForceDeviceScaleFactor, base::StringPrintf("%f", scale())); WebViewAPITest::SetUp(); } -- cgit v1.1