summaryrefslogtreecommitdiffstats
path: root/extensions/browser/guest_view
diff options
context:
space:
mode:
authoralexmos <alexmos@chromium.org>2015-12-01 18:03:09 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-02 02:04:04 +0000
commit9d656a8ca02c72b84df27110d54d025b2639cf84 (patch)
tree6cfd2f72b7c206caf1f34ccc8564b313204d23ce /extensions/browser/guest_view
parente18ce07ccb40aa6097764dc73ca0ebc3cf624c03 (diff)
downloadchromium_src-9d656a8ca02c72b84df27110d54d025b2639cf84.zip
chromium_src-9d656a8ca02c72b84df27110d54d025b2639cf84.tar.gz
chromium_src-9d656a8ca02c72b84df27110d54d025b2639cf84.tar.bz2
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}
Diffstat (limited to 'extensions/browser/guest_view')
-rw-r--r--extensions/browser/guest_view/web_view/web_view_apitest.cc15
1 files changed, 9 insertions, 6 deletions
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();
}