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

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

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/extensions/extension_webrequest_api.h" 7 #include "chrome/browser/extensions/extension_webrequest_api.h"
8 #include "chrome/browser/ui/login/login_prompt.h" 8 #include "chrome/browser/ui/login/login_prompt.h"
9 #include "chrome/common/chrome_notification_types.h" 9 #include "chrome/common/chrome_notification_types.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
11 #include "content/public/browser/notification_registrar.h" 11 #include "content/public/browser/notification_registrar.h"
12 #include "content/common/notification_service.h" 12 #include "content/public/browser/notification_service.h"
13 #include "net/base/mock_host_resolver.h" 13 #include "net/base/mock_host_resolver.h"
14 14
15 namespace { 15 namespace {
16 16
17 class CancelLoginDialog : public content::NotificationObserver { 17 class CancelLoginDialog : public content::NotificationObserver {
18 public: 18 public:
19 CancelLoginDialog() { 19 CancelLoginDialog() {
20 registrar_.Add(this, 20 registrar_.Add(this,
21 chrome::NOTIFICATION_AUTH_NEEDED, 21 chrome::NOTIFICATION_AUTH_NEEDED,
22 NotificationService::AllSources()); 22 content::NotificationService::AllSources());
23 } 23 }
24 24
25 virtual ~CancelLoginDialog() {} 25 virtual ~CancelLoginDialog() {}
26 26
27 virtual void Observe(int type, 27 virtual void Observe(int type,
28 const content::NotificationSource& source, 28 const content::NotificationSource& source,
29 const content::NotificationDetails& details) { 29 const content::NotificationDetails& details) {
30 LoginHandler* handler = 30 LoginHandler* handler =
31 content::Details<LoginNotificationDetails>(details).ptr()->handler(); 31 content::Details<LoginNotificationDetails>(details).ptr()->handler();
32 handler->CancelAuth(); 32 handler->CancelAuth();
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 // Hangs flakily: http://crbug.com/91715 85 // Hangs flakily: http://crbug.com/91715
86 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, 86 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
87 DISABLED_WebRequestBlocking) { 87 DISABLED_WebRequestBlocking) {
88 CommandLine::ForCurrentProcess()->AppendSwitch( 88 CommandLine::ForCurrentProcess()->AppendSwitch(
89 switches::kEnableExperimentalExtensionApis); 89 switches::kEnableExperimentalExtensionApis);
90 90
91 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_blocking.html")) << 91 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_blocking.html")) <<
92 message_; 92 message_;
93 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698