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

Unified Diff: chrome/browser/ui/views/accessibility_event_router_views_unittest.cc

Issue 6961027: Change event routers from singletons to being owned by the ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: all is built on sand Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/accessibility_event_router_views.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
diff --git a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
index c288e91bbc34edcb26fd59d125eec2824adff2cc..6ff9399e8d788d5ce886a9a67c0542a955881b7a 100644
--- a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
+++ b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
@@ -8,6 +8,8 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_accessibility_api.h"
+#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/test_extension_service.h"
#include "chrome/browser/ui/views/accessibility_event_router_views.h"
#include "chrome/test/testing_profile.h"
#include "content/common/notification_registrar.h"
@@ -143,6 +145,15 @@ TEST_F(AccessibilityEventRouterViewsTest, TestFocusNotification) {
// Put the view in a window.
views::Window* window = CreateWindowWithContents(contents);
+ // Create a profile and associate it with this window.
+ TestingProfile profile;
+ window->AsWidget()->native_widget()->SetNativeWindowProperty(
+ Profile::kProfileKey, &profile);
+
+ // To begin with, accessibility event notifications are off.
+ AccessibilityEventRouterViews::GetInstance()->
+ SetAccessibilityEnabledForTesting(false);
+
// Set focus to the first button initially.
button1->RequestFocus();
@@ -153,14 +164,8 @@ TEST_F(AccessibilityEventRouterViewsTest, TestFocusNotification) {
NotificationService::AllSources());
// Switch on accessibility event notifications.
- ExtensionAccessibilityEventRouter* accessibility_event_router =
- ExtensionAccessibilityEventRouter::GetInstance();
- accessibility_event_router->SetAccessibilityEnabled(true);
-
- // Create a profile and associate it with this window.
- TestingProfile profile;
- window->AsWidget()->native_widget()->SetNativeWindowProperty(
- Profile::kProfileKey, &profile);
+ AccessibilityEventRouterViews::GetInstance()->
+ SetAccessibilityEnabledForTesting(true);
// Change the accessible name of button3.
button3->SetAccessibleName(ASCIIToUTF16(kButton3NewASCII));
« no previous file with comments | « chrome/browser/ui/views/accessibility_event_router_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698