Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: chrome/browser/extensions/extension_browsertest.cc

Issue 7595005: Revert 95815 - Make extension file URL access opt-in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_prefs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698