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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 227 } |
228 | 228 |
229 // Toggling incognito or file access will reload the extension, so wait for | 229 // Toggling incognito or file access will reload the extension, so wait for |
230 // the reload and grab the new extension instance. The default state is | 230 // the reload and grab the new extension instance. The default state is |
231 // incognito disabled and file access enabled, so we don't wait in those | 231 // incognito disabled and file access enabled, so we don't wait in those |
232 // cases. | 232 // cases. |
233 { | 233 { |
234 content::WindowedNotificationObserver load_signal( | 234 content::WindowedNotificationObserver load_signal( |
235 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, | 235 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
236 content::Source<Profile>(profile())); | 236 content::Source<Profile>(profile())); |
237 CHECK(!extensions::util::IsIncognitoEnabled(extension_id, profile())); | 237 CHECK(!extensions::util::IsIncognitoEnabled(extension_id, profile())) |
| 238 << extension_id << " is enabled in incognito, but shouldn't be"; |
238 | 239 |
239 if (flags & kFlagEnableIncognito) { | 240 if (flags & kFlagEnableIncognito) { |
240 extensions::util::SetIsIncognitoEnabled(extension_id, profile(), true); | 241 extensions::util::SetIsIncognitoEnabled(extension_id, profile(), true); |
241 load_signal.Wait(); | 242 load_signal.Wait(); |
242 extension = service->GetExtensionById(extension_id, false); | 243 extension = service->GetExtensionById(extension_id, false); |
243 CHECK(extension) << extension_id << " not found after reloading."; | 244 CHECK(extension) << extension_id << " not found after reloading."; |
244 } | 245 } |
245 } | 246 } |
246 | 247 |
247 { | 248 { |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( | 661 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( |
661 profile(), extension_id, script); | 662 profile(), extension_id, script); |
662 } | 663 } |
663 | 664 |
664 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( | 665 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( |
665 const std::string& extension_id, | 666 const std::string& extension_id, |
666 const std::string& script) { | 667 const std::string& script) { |
667 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( | 668 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( |
668 profile(), extension_id, script); | 669 profile(), extension_id, script); |
669 } | 670 } |
OLD | NEW |