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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 void ExtensionBrowserTest::SetUp() { | 122 void ExtensionBrowserTest::SetUp() { |
123 test_extension_cache_.reset(new extensions::ExtensionCacheFake()); | 123 test_extension_cache_.reset(new extensions::ExtensionCacheFake()); |
124 InProcessBrowserTest::SetUp(); | 124 InProcessBrowserTest::SetUp(); |
125 } | 125 } |
126 | 126 |
127 void ExtensionBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { | 127 void ExtensionBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { |
128 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); | 128 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); |
129 test_data_dir_ = test_data_dir_.AppendASCII("extensions"); | 129 test_data_dir_ = test_data_dir_.AppendASCII("extensions"); |
130 observer_.reset(new ExtensionTestNotificationObserver(browser())); | 130 observer_.reset(new ChromeExtensionTestNotificationObserver(browser())); |
131 | 131 |
132 // We don't want any warning bubbles for, e.g., unpacked extensions. | 132 // We don't want any warning bubbles for, e.g., unpacked extensions. |
133 ExtensionMessageBubbleFactory::set_override_for_tests( | 133 ExtensionMessageBubbleFactory::set_override_for_tests( |
134 ExtensionMessageBubbleFactory::OVERRIDE_DISABLED); | 134 ExtensionMessageBubbleFactory::OVERRIDE_DISABLED); |
135 | 135 |
136 #if defined(OS_CHROMEOS) | 136 #if defined(OS_CHROMEOS) |
137 if (set_chromeos_user_) { | 137 if (set_chromeos_user_) { |
138 // This makes sure that we create the Default profile first, with no | 138 // This makes sure that we create the Default profile first, with no |
139 // ExtensionService and then the real profile with one, as we do when | 139 // ExtensionService and then the real profile with one, as we do when |
140 // running on chromeos. | 140 // running on chromeos. |
141 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, | 141 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
142 "testuser@gmail.com"); | 142 "testuser@gmail.com"); |
143 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | 143 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
144 } | 144 } |
145 #endif | 145 #endif |
146 } | 146 } |
147 | 147 |
148 void ExtensionBrowserTest::SetUpOnMainThread() { | 148 void ExtensionBrowserTest::SetUpOnMainThread() { |
149 InProcessBrowserTest::SetUpOnMainThread(); | 149 InProcessBrowserTest::SetUpOnMainThread(); |
150 observer_.reset(new ExtensionTestNotificationObserver(browser())); | 150 observer_.reset(new ChromeExtensionTestNotificationObserver(browser())); |
151 if (extension_service()->updater()) { | 151 if (extension_service()->updater()) { |
152 extension_service()->updater()->SetExtensionCacheForTesting( | 152 extension_service()->updater()->SetExtensionCacheForTesting( |
153 test_extension_cache_.get()); | 153 test_extension_cache_.get()); |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 void ExtensionBrowserTest::TearDownOnMainThread() { | 157 void ExtensionBrowserTest::TearDownOnMainThread() { |
158 ExtensionMessageBubbleFactory::set_override_for_tests( | 158 ExtensionMessageBubbleFactory::set_override_for_tests( |
159 ExtensionMessageBubbleFactory::NO_OVERRIDE); | 159 ExtensionMessageBubbleFactory::NO_OVERRIDE); |
160 InProcessBrowserTest::TearDownOnMainThread(); | 160 InProcessBrowserTest::TearDownOnMainThread(); |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( | 638 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( |
639 profile(), extension_id, script); | 639 profile(), extension_id, script); |
640 } | 640 } |
641 | 641 |
642 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( | 642 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( |
643 const std::string& extension_id, | 643 const std::string& extension_id, |
644 const std::string& script) { | 644 const std::string& script) { |
645 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( | 645 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( |
646 profile(), extension_id, script); | 646 profile(), extension_id, script); |
647 } | 647 } |
OLD | NEW |