Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc

Issue 2692153002: Enable SiteIsolationExtensions trial for developers. (Closed)
Patch Set: Fix failing test classes subclassing ExtensionApiTest. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 ExtensionWebstorePrivateApiTest() {} 103 ExtensionWebstorePrivateApiTest() {}
104 ~ExtensionWebstorePrivateApiTest() override {} 104 ~ExtensionWebstorePrivateApiTest() override {}
105 105
106 void SetUpCommandLine(base::CommandLine* command_line) override { 106 void SetUpCommandLine(base::CommandLine* command_line) override {
107 ExtensionApiTest::SetUpCommandLine(command_line); 107 ExtensionApiTest::SetUpCommandLine(command_line);
108 command_line->AppendSwitchASCII( 108 command_line->AppendSwitchASCII(
109 switches::kAppsGalleryURL, 109 switches::kAppsGalleryURL,
110 "http://www.example.com/extensions/api_test"); 110 "http://www.example.com/extensions/api_test");
111 } 111 }
112 112
113 void SetUpInProcessBrowserTestFixture() override { 113 void SetUpOnMainThread() override {
114 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); 114 ExtensionApiTest::SetUpOnMainThread();
115 115
116 // Start up the test server and get us ready for calling the install 116 // Start up the test server and get us ready for calling the install
117 // API functions. 117 // API functions.
118 host_resolver()->AddRule("www.example.com", "127.0.0.1"); 118 host_resolver()->AddRule("www.example.com", "127.0.0.1");
119 ASSERT_TRUE(StartEmbeddedTestServer()); 119 ASSERT_TRUE(StartEmbeddedTestServer());
120 extensions::ExtensionInstallUI::set_disable_failure_ui_for_tests(); 120 extensions::ExtensionInstallUI::set_disable_failure_ui_for_tests();
121 }
122
123 void SetUpOnMainThread() override {
124 ExtensionApiTest::SetUpOnMainThread();
125 121
126 auto_confirm_install_.reset( 122 auto_confirm_install_.reset(
127 new ScopedTestDialogAutoConfirm(ScopedTestDialogAutoConfirm::ACCEPT)); 123 new ScopedTestDialogAutoConfirm(ScopedTestDialogAutoConfirm::ACCEPT));
128 124
129 ASSERT_TRUE(webstore_install_dir_.CreateUniqueTempDir()); 125 ASSERT_TRUE(webstore_install_dir_.CreateUniqueTempDir());
130 webstore_install_dir_copy_ = webstore_install_dir_.GetPath(); 126 webstore_install_dir_copy_ = webstore_install_dir_.GetPath();
131 WebstoreInstaller::SetDownloadDirectoryForTests( 127 WebstoreInstaller::SetDownloadDirectoryForTests(
132 &webstore_install_dir_copy_); 128 &webstore_install_dir_copy_);
133 } 129 }
134 130
131 void TearDownOnMainThread() override {
Devlin 2017/02/15 19:24:34 Shouldn't need this.
nasko 2017/02/15 19:34:57 Done.
132 ExtensionApiTest::TearDownOnMainThread();
133 }
134
135 protected: 135 protected:
136 // Returns a test server URL, but with host 'www.example.com' so it matches 136 // Returns a test server URL, but with host 'www.example.com' so it matches
137 // the web store app's extent that we set up via command line flags. 137 // the web store app's extent that we set up via command line flags.
138 GURL DoGetTestServerURL(const std::string& path) { 138 GURL DoGetTestServerURL(const std::string& path) {
139 GURL url = embedded_test_server()->GetURL(path); 139 GURL url = embedded_test_server()->GetURL(path);
140 140
141 // Replace the host with 'www.example.com' so it matches the web store 141 // Replace the host with 'www.example.com' so it matches the web store
142 // app's extent. 142 // app's extent.
143 GURL::Replacements replace_host; 143 GURL::Replacements replace_host;
144 replace_host.SetHostStr("www.example.com"); 144 replace_host.SetHostStr("www.example.com");
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 content::GpuDataManager::GetInstance()->InitializeForTesting( 435 content::GpuDataManager::GetInstance()->InitializeForTesting(
436 json_blacklist, gpu_info); 436 json_blacklist, gpu_info);
437 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( 437 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted(
438 gpu::GPU_FEATURE_TYPE_WEBGL)); 438 gpu::GPU_FEATURE_TYPE_WEBGL));
439 439
440 bool webgl_allowed = false; 440 bool webgl_allowed = false;
441 RunTest(webgl_allowed); 441 RunTest(webgl_allowed);
442 } 442 }
443 443
444 } // namespace extensions 444 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698