| 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/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 syncer::StringOrdinal::CreateInitialOrdinal()); | 178 syncer::StringOrdinal::CreateInitialOrdinal()); |
| 179 | 179 |
| 180 // Toggling incognito or file access will reload the extension, so wait for | 180 // Toggling incognito or file access will reload the extension, so wait for |
| 181 // the reload and grab the new extension instance. The default state is | 181 // the reload and grab the new extension instance. The default state is |
| 182 // incognito disabled and file access enabled, so we don't wait in those | 182 // incognito disabled and file access enabled, so we don't wait in those |
| 183 // cases. | 183 // cases. |
| 184 { | 184 { |
| 185 content::WindowedNotificationObserver load_signal( | 185 content::WindowedNotificationObserver load_signal( |
| 186 chrome::NOTIFICATION_EXTENSION_LOADED, | 186 chrome::NOTIFICATION_EXTENSION_LOADED, |
| 187 content::Source<Profile>(profile())); | 187 content::Source<Profile>(profile())); |
| 188 CHECK(!extensions::util::IsIncognitoEnabled(extension_id, profile()) || | 188 CHECK(!extensions::util::IsIncognitoEnabled(extension_id, profile())); |
| 189 extension->force_incognito_enabled()); | |
| 190 | 189 |
| 191 if (flags & kFlagEnableIncognito) { | 190 if (flags & kFlagEnableIncognito) { |
| 192 extensions::util::SetIsIncognitoEnabled(extension_id, profile(), true); | 191 extensions::util::SetIsIncognitoEnabled(extension_id, profile(), true); |
| 193 load_signal.Wait(); | 192 load_signal.Wait(); |
| 194 extension = service->GetExtensionById(extension_id, false); | 193 extension = service->GetExtensionById(extension_id, false); |
| 195 CHECK(extension) << extension_id << " not found after reloading."; | 194 CHECK(extension) << extension_id << " not found after reloading."; |
| 196 } | 195 } |
| 197 } | 196 } |
| 198 | 197 |
| 199 { | 198 { |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 EXPECT_EQ(expected_hosts, num_hosts); | 589 EXPECT_EQ(expected_hosts, num_hosts); |
| 591 return host; | 590 return host; |
| 592 } | 591 } |
| 593 | 592 |
| 594 std::string ExtensionBrowserTest::ExecuteScriptInBackgroundPage( | 593 std::string ExtensionBrowserTest::ExecuteScriptInBackgroundPage( |
| 595 const std::string& extension_id, | 594 const std::string& extension_id, |
| 596 const std::string& script) { | 595 const std::string& script) { |
| 597 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( | 596 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( |
| 598 profile(), extension_id, script); | 597 profile(), extension_id, script); |
| 599 } | 598 } |
| OLD | NEW |