| 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_browsertest.h" | 5 #include "chrome/browser/extensions/extension_browsertest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // ExtensionService and then the real profile with one, as we do when | 178 // ExtensionService and then the real profile with one, as we do when |
| 179 // running on chromeos. | 179 // running on chromeos. |
| 180 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, | 180 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
| 181 "testuser@gmail.com"); | 181 "testuser@gmail.com"); |
| 182 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | 182 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
| 183 } | 183 } |
| 184 #endif | 184 #endif |
| 185 } | 185 } |
| 186 | 186 |
| 187 void ExtensionBrowserTest::SetUpOnMainThread() { | 187 void ExtensionBrowserTest::SetUpOnMainThread() { |
| 188 InProcessBrowserTest::SetUpOnMainThread(); | |
| 189 observer_.reset( | 188 observer_.reset( |
| 190 new extensions::ChromeExtensionTestNotificationObserver(browser())); | 189 new extensions::ChromeExtensionTestNotificationObserver(browser())); |
| 191 if (extension_service()->updater()) { | 190 if (extension_service()->updater()) { |
| 192 extension_service()->updater()->SetExtensionCacheForTesting( | 191 extension_service()->updater()->SetExtensionCacheForTesting( |
| 193 test_extension_cache_.get()); | 192 test_extension_cache_.get()); |
| 194 } | 193 } |
| 195 | 194 |
| 196 // We don't use test_data_dir_ here because we want this to point to | 195 // We don't use test_data_dir_ here because we want this to point to |
| 197 // chrome/test/data/extensions, and subclasses have a nasty habit of altering | 196 // chrome/test/data/extensions, and subclasses have a nasty habit of altering |
| 198 // the data dir in SetUpCommandLine(). | 197 // the data dir in SetUpCommandLine(). |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( | 603 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( |
| 605 profile(), extension_id, script); | 604 profile(), extension_id, script); |
| 606 } | 605 } |
| 607 | 606 |
| 608 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( | 607 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( |
| 609 const std::string& extension_id, | 608 const std::string& extension_id, |
| 610 const std::string& script) { | 609 const std::string& script) { |
| 611 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( | 610 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( |
| 612 profile(), extension_id, script); | 611 profile(), extension_id, script); |
| 613 } | 612 } |
| OLD | NEW |