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

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

Issue 9195018: Disable modal JavaScript dialogs for platform apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 8 years, 11 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
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 const Extension* ExtensionBrowserTest::LoadExtension(const FilePath& path) { 136 const Extension* ExtensionBrowserTest::LoadExtension(const FilePath& path) {
137 return LoadExtensionWithOptions(path, false, true); 137 return LoadExtensionWithOptions(path, false, true);
138 } 138 }
139 139
140 const Extension* ExtensionBrowserTest::LoadExtensionIncognito( 140 const Extension* ExtensionBrowserTest::LoadExtensionIncognito(
141 const FilePath& path) { 141 const FilePath& path) {
142 return LoadExtensionWithOptions(path, true, true); 142 return LoadExtensionWithOptions(path, true, true);
143 } 143 }
144 144
145 bool ExtensionBrowserTest::LoadExtensionAsComponent(const FilePath& path) { 145 const Extension* ExtensionBrowserTest::LoadExtensionAsComponent(
146 const FilePath& path) {
146 ExtensionService* service = browser()->profile()->GetExtensionService(); 147 ExtensionService* service = browser()->profile()->GetExtensionService();
147 148
148 std::string manifest; 149 std::string manifest;
149 if (!file_util::ReadFileToString(path.Append(Extension::kManifestFilename), 150 if (!file_util::ReadFileToString(path.Append(Extension::kManifestFilename),
150 &manifest)) 151 &manifest))
151 return false; 152 return NULL;
152 153
153 service->component_loader()->Add(manifest, path); 154 const Extension* extension =
154 155 service->component_loader()->Add(manifest, path);
155 return true; 156 if (!extension)
157 return NULL;
158 last_loaded_extension_id_ = extension->id();
159 return extension;
156 } 160 }
157 161
158 FilePath ExtensionBrowserTest::PackExtension(const FilePath& dir_path) { 162 FilePath ExtensionBrowserTest::PackExtension(const FilePath& dir_path) {
159 FilePath crx_path = temp_dir_.path().AppendASCII("temp.crx"); 163 FilePath crx_path = temp_dir_.path().AppendASCII("temp.crx");
160 if (!file_util::Delete(crx_path, false)) { 164 if (!file_util::Delete(crx_path, false)) {
161 ADD_FAILURE() << "Failed to delete crx: " << crx_path.value(); 165 ADD_FAILURE() << "Failed to delete crx: " << crx_path.value();
162 return FilePath(); 166 return FilePath();
163 } 167 }
164 168
165 FilePath pem_path = crx_path.DirName().AppendASCII("temp.pem"); 169 FilePath pem_path = crx_path.DirName().AppendASCII("temp.pem");
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 MessageLoopForUI::current()->Quit(); 504 MessageLoopForUI::current()->Quit();
501 } 505 }
502 break; 506 break;
503 } 507 }
504 508
505 default: 509 default:
506 NOTREACHED(); 510 NOTREACHED();
507 break; 511 break;
508 } 512 }
509 } 513 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_browsertest.h ('k') | chrome/browser/extensions/extension_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698