OLD | NEW |
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 "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 149 } |
150 | 150 |
151 ExtensionApiTest::~ExtensionApiTest() {} | 151 ExtensionApiTest::~ExtensionApiTest() {} |
152 | 152 |
153 void ExtensionApiTest::SetUpInProcessBrowserTestFixture() { | 153 void ExtensionApiTest::SetUpInProcessBrowserTestFixture() { |
154 DCHECK(!test_config_.get()) << "Previous test did not clear config state."; | 154 DCHECK(!test_config_.get()) << "Previous test did not clear config state."; |
155 test_config_.reset(new base::DictionaryValue()); | 155 test_config_.reset(new base::DictionaryValue()); |
156 test_config_->SetString(kTestDataDirectory, | 156 test_config_->SetString(kTestDataDirectory, |
157 net::FilePathToFileURL(test_data_dir_).spec()); | 157 net::FilePathToFileURL(test_data_dir_).spec()); |
158 test_config_->SetInteger(kTestWebSocketPort, 0); | 158 test_config_->SetInteger(kTestWebSocketPort, 0); |
159 bool isolate_extensions = base::CommandLine::ForCurrentProcess()->HasSwitch( | 159 bool isolate_extensions = true; |
160 switches::kSitePerProcess) || | |
161 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
162 extensions::switches::kIsolateExtensions); | |
163 test_config_->SetBoolean(kIsolateExtensions, isolate_extensions); | 160 test_config_->SetBoolean(kIsolateExtensions, isolate_extensions); |
164 extensions::TestGetConfigFunction::set_test_config_state( | 161 extensions::TestGetConfigFunction::set_test_config_state( |
165 test_config_.get()); | 162 test_config_.get()); |
166 } | 163 } |
167 | 164 |
168 void ExtensionApiTest::TearDownInProcessBrowserTestFixture() { | 165 void ExtensionApiTest::TearDownInProcessBrowserTestFixture() { |
169 extensions::TestGetConfigFunction::set_test_config_state(NULL); | 166 extensions::TestGetConfigFunction::set_test_config_state(NULL); |
170 test_config_.reset(NULL); | 167 test_config_.reset(NULL); |
171 } | 168 } |
172 | 169 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 } | 431 } |
435 | 432 |
436 void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) { | 433 void ExtensionApiTest::SetUpCommandLine(base::CommandLine* command_line) { |
437 ExtensionBrowserTest::SetUpCommandLine(command_line); | 434 ExtensionBrowserTest::SetUpCommandLine(command_line); |
438 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); | 435 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); |
439 // Backgrounded renderer processes run at a lower priority, causing the | 436 // Backgrounded renderer processes run at a lower priority, causing the |
440 // tests to take more time to complete. Disable backgrounding so that the | 437 // tests to take more time to complete. Disable backgrounding so that the |
441 // tests don't time out. | 438 // tests don't time out. |
442 command_line->AppendSwitch(switches::kDisableRendererBackgrounding); | 439 command_line->AppendSwitch(switches::kDisableRendererBackgrounding); |
443 } | 440 } |
OLD | NEW |