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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_view_browsertest.cc

Issue 7024056: Handle extension webrequest API on the IO thread. This speeds up blocking event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix broken test Created 9 years, 6 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/i18n/time_formatting.h" 6 #include "base/i18n/time_formatting.h"
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 if (!options_page.empty()) { 208 if (!options_page.empty()) {
209 input_value.SetString(extension_manifest_keys::kOptionsPage, 209 input_value.SetString(extension_manifest_keys::kOptionsPage,
210 options_page); 210 options_page);
211 } 211 }
212 std::string error; 212 std::string error;
213 scoped_refptr<Extension> extension = Extension::Create( 213 scoped_refptr<Extension> extension = Extension::Create(
214 full_path, location, input_value, Extension::STRICT_ERROR_CHECKS, 214 full_path, location, input_value, Extension::STRICT_ERROR_CHECKS,
215 &error); 215 &error);
216 ASSERT_TRUE(extension.get()); 216 ASSERT_TRUE(extension.get());
217 EXPECT_STREQ("", error.c_str()); 217 EXPECT_STREQ("", error.c_str());
218 browser()->GetProfile()->GetExtensionService()->AddExtension( 218 browser()->GetProfile()->GetExtensionService()->OnLoadSingleExtension(
219 extension.get()); 219 extension.get());
220 220
221 // Makes sure that async task ExtensionPrefs::OnExtensionInstalled gets a 221 // Makes sure that async task ExtensionPrefs::OnExtensionInstalled gets a
Mihai Parparita -not on Chrome 2011/06/08 01:11:59 Isn't OnExtensionInstalled invoked directly/synchr
Matt Perry 2011/06/08 20:47:00 I changed it to OnLoadSingleExtension so that it w
222 // chance to be procesed. 222 // chance to be procesed.
223 MessageLoop::current()->RunAllPending(); 223 MessageLoop::current()->RunAllPending();
224 224
225 // Creates a panel with the app name that comes from the extension ID. 225 // Creates a panel with the app name that comes from the extension ID.
226 PanelBrowserView* browser_view = CreatePanelBrowserView( 226 PanelBrowserView* browser_view = CreatePanelBrowserView(
227 web_app::GenerateApplicationNameFromExtensionId(extension->id())); 227 web_app::GenerateApplicationNameFromExtensionId(extension->id()));
228 PanelBrowserFrameView* frame_view = browser_view->GetFrameView(); 228 PanelBrowserFrameView* frame_view = browser_view->GetFrameView();
229 229
230 frame_view->EnsureSettingsMenuCreated(); 230 frame_view->EnsureSettingsMenuCreated();
231 ASSERT_TRUE(frame_view->settings_menu_.get()); 231 ASSERT_TRUE(frame_view->settings_menu_.get());
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 556
557 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, CreateSettingsMenu) { 557 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, CreateSettingsMenu) {
558 TestCreateSettingsMenuForExtension( 558 TestCreateSettingsMenuForExtension(
559 FILE_PATH_LITERAL("extension1"), Extension::EXTERNAL_POLICY_DOWNLOAD, 559 FILE_PATH_LITERAL("extension1"), Extension::EXTERNAL_POLICY_DOWNLOAD,
560 "", ""); 560 "", "");
561 TestCreateSettingsMenuForExtension( 561 TestCreateSettingsMenuForExtension(
562 FILE_PATH_LITERAL("extension2"), Extension::INVALID, 562 FILE_PATH_LITERAL("extension2"), Extension::INVALID,
563 "http://home", "options.html"); 563 "http://home", "options.html");
564 } 564 }
565 #endif 565 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698