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_path.h" | 10 #include "base/file_path.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
31 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
32 #include "chrome/common/chrome_version_info.h" | 32 #include "chrome/common/chrome_version_info.h" |
33 #include "chrome/test/base/ui_test_utils.h" | 33 #include "chrome/test/base/ui_test_utils.h" |
34 #include "content/public/browser/navigation_controller.h" | 34 #include "content/public/browser/navigation_controller.h" |
35 #include "content/public/browser/navigation_entry.h" | 35 #include "content/public/browser/navigation_entry.h" |
36 #include "content/public/browser/notification_registrar.h" | 36 #include "content/public/browser/notification_registrar.h" |
37 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
38 #include "content/public/browser/render_view_host.h" | 38 #include "content/public/browser/render_view_host.h" |
39 #include "content/public/test/browser_test_utils.h" | 39 #include "content/public/test/browser_test_utils.h" |
| 40 #include "sync/api/string_ordinal.h" |
40 | 41 |
41 using extensions::Extension; | 42 using extensions::Extension; |
42 using extensions::ExtensionCreator; | 43 using extensions::ExtensionCreator; |
43 | 44 |
44 ExtensionBrowserTest::ExtensionBrowserTest() | 45 ExtensionBrowserTest::ExtensionBrowserTest() |
45 : loaded_(false), | 46 : loaded_(false), |
46 installed_(false), | 47 installed_(false), |
47 extension_installs_observed_(0), | 48 extension_installs_observed_(0), |
48 extension_load_errors_observed_(0), | 49 extension_load_errors_observed_(0), |
49 target_page_action_count_(-1), | 50 target_page_action_count_(-1), |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 return NULL; | 122 return NULL; |
122 } | 123 } |
123 } | 124 } |
124 | 125 |
125 const std::string extension_id = extension->id(); | 126 const std::string extension_id = extension->id(); |
126 | 127 |
127 // The call to OnExtensionInstalled ensures the other extension prefs | 128 // The call to OnExtensionInstalled ensures the other extension prefs |
128 // are set up with the defaults. | 129 // are set up with the defaults. |
129 service->extension_prefs()->OnExtensionInstalled( | 130 service->extension_prefs()->OnExtensionInstalled( |
130 extension, Extension::ENABLED, false, | 131 extension, Extension::ENABLED, false, |
131 StringOrdinal::CreateInitialOrdinal()); | 132 syncer::StringOrdinal::CreateInitialOrdinal()); |
132 | 133 |
133 // Toggling incognito or file access will reload the extension, so wait for | 134 // Toggling incognito or file access will reload the extension, so wait for |
134 // the reload and grab the new extension instance. The default state is | 135 // the reload and grab the new extension instance. The default state is |
135 // incognito disabled and file access enabled, so we don't wait in those | 136 // incognito disabled and file access enabled, so we don't wait in those |
136 // cases. | 137 // cases. |
137 { | 138 { |
138 content::WindowedNotificationObserver load_signal( | 139 content::WindowedNotificationObserver load_signal( |
139 chrome::NOTIFICATION_EXTENSION_LOADED, | 140 chrome::NOTIFICATION_EXTENSION_LOADED, |
140 content::Source<Profile>(browser()->profile())); | 141 content::Source<Profile>(browser()->profile())); |
141 CHECK(!service->IsIncognitoEnabled(extension_id)); | 142 CHECK(!service->IsIncognitoEnabled(extension_id)); |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 case content::NOTIFICATION_LOAD_STOP: | 676 case content::NOTIFICATION_LOAD_STOP: |
676 VLOG(1) << "Got LOAD_STOP notification."; | 677 VLOG(1) << "Got LOAD_STOP notification."; |
677 MessageLoopForUI::current()->Quit(); | 678 MessageLoopForUI::current()->Quit(); |
678 break; | 679 break; |
679 | 680 |
680 default: | 681 default: |
681 NOTREACHED(); | 682 NOTREACHED(); |
682 break; | 683 break; |
683 } | 684 } |
684 } | 685 } |
OLD | NEW |