OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 load_signal.Wait(); | 107 load_signal.Wait(); |
108 extension = service->GetExtensionById(extension_id, false); | 108 extension = service->GetExtensionById(extension_id, false); |
109 CHECK(extension) << extension_id << " not found after reloading."; | 109 CHECK(extension) << extension_id << " not found after reloading."; |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 { | 113 { |
114 ui_test_utils::WindowedNotificationObserver load_signal( | 114 ui_test_utils::WindowedNotificationObserver load_signal( |
115 chrome::NOTIFICATION_EXTENSION_LOADED, | 115 chrome::NOTIFICATION_EXTENSION_LOADED, |
116 Source<Profile>(browser()->profile())); | 116 Source<Profile>(browser()->profile())); |
117 CHECK(!service->AllowFileAccess(extension)); | 117 CHECK(service->AllowFileAccess(extension)); |
118 | 118 |
119 if (fileaccess_enabled) { | 119 if (!fileaccess_enabled) { |
120 service->SetAllowFileAccess(extension, fileaccess_enabled); | 120 service->SetAllowFileAccess(extension, fileaccess_enabled); |
121 load_signal.Wait(); | 121 load_signal.Wait(); |
122 extension = service->GetExtensionById(extension_id, false); | 122 extension = service->GetExtensionById(extension_id, false); |
123 CHECK(extension) << extension_id << " not found after reloading."; | 123 CHECK(extension) << extension_id << " not found after reloading."; |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 if (!WaitForExtensionHostsToLoad()) | 127 if (!WaitForExtensionHostsToLoad()) |
128 return NULL; | 128 return NULL; |
129 | 129 |
130 return extension; | 130 return extension; |
131 } | 131 } |
132 | 132 |
133 const Extension* ExtensionBrowserTest::LoadExtension(const FilePath& path) { | 133 const Extension* ExtensionBrowserTest::LoadExtension(const FilePath& path) { |
134 return LoadExtensionWithOptions(path, false, false); | 134 return LoadExtensionWithOptions(path, false, true); |
135 } | 135 } |
136 | 136 |
137 const Extension* ExtensionBrowserTest::LoadExtensionIncognito( | 137 const Extension* ExtensionBrowserTest::LoadExtensionIncognito( |
138 const FilePath& path) { | 138 const FilePath& path) { |
139 return LoadExtensionWithOptions(path, true, true); | 139 return LoadExtensionWithOptions(path, true, true); |
140 } | 140 } |
141 | 141 |
142 bool ExtensionBrowserTest::LoadExtensionAsComponent(const FilePath& path) { | 142 bool ExtensionBrowserTest::LoadExtensionAsComponent(const FilePath& path) { |
143 ExtensionService* service = browser()->profile()->GetExtensionService(); | 143 ExtensionService* service = browser()->profile()->GetExtensionService(); |
144 | 144 |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 MessageLoopForUI::current()->Quit(); | 465 MessageLoopForUI::current()->Quit(); |
466 } | 466 } |
467 break; | 467 break; |
468 } | 468 } |
469 | 469 |
470 default: | 470 default: |
471 NOTREACHED(); | 471 NOTREACHED(); |
472 break; | 472 break; |
473 } | 473 } |
474 } | 474 } |
OLD | NEW |