OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
6 #include "chrome/browser/extensions/extension_service.h" | 6 #include "chrome/browser/extensions/extension_service.h" |
7 #include "chrome/browser/extensions/extension_web_ui.h" | 7 #include "chrome/browser/extensions/extension_web_ui.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 9 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 return true; | 44 return true; |
45 } | 45 } |
46 | 46 |
47 #if defined(USE_VIRTUAL_KEYBOARD) | 47 #if defined(USE_VIRTUAL_KEYBOARD) |
48 // Navigate to the keyboard page, and ensure we have arrived at an | 48 // Navigate to the keyboard page, and ensure we have arrived at an |
49 // extension URL. | 49 // extension URL. |
50 void NavigateToKeyboard() { | 50 void NavigateToKeyboard() { |
51 ui_test_utils::NavigateToURL(browser(), GURL("chrome://keyboard/")); | 51 ui_test_utils::NavigateToURL(browser(), GURL("chrome://keyboard/")); |
52 WebContents* tab = browser()->GetSelectedWebContents(); | 52 WebContents* tab = browser()->GetSelectedWebContents(); |
53 ASSERT_TRUE(tab->GetController().GetActiveEntry()); | 53 ASSERT_TRUE(tab->GetController().GetActiveEntry()); |
54 EXPECT_TRUE(tab->GetController().GetActiveEntry()->url(). | 54 EXPECT_TRUE(tab->GetController().GetActiveEntry()->GetURL(). |
55 SchemeIs(chrome::kExtensionScheme)); | 55 SchemeIs(chrome::kExtensionScheme)); |
56 } | 56 } |
57 #endif | 57 #endif |
58 }; | 58 }; |
59 | 59 |
60 IN_PROC_BROWSER_TEST_F(ExtensionOverrideTest, OverrideNewtab) { | 60 IN_PROC_BROWSER_TEST_F(ExtensionOverrideTest, OverrideNewtab) { |
61 ASSERT_TRUE(RunExtensionTest("override/newtab")) << message_; | 61 ASSERT_TRUE(RunExtensionTest("override/newtab")) << message_; |
62 { | 62 { |
63 ResultCatcher catcher; | 63 ResultCatcher catcher; |
64 // Navigate to the new tab page. The overridden new tab page | 64 // Navigate to the new tab page. The overridden new tab page |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 // Unload the failing version. We should be back to passing now. | 176 // Unload the failing version. We should be back to passing now. |
177 UnloadExtension(extension->id()); | 177 UnloadExtension(extension->id()); |
178 { | 178 { |
179 ResultCatcher catcher; | 179 ResultCatcher catcher; |
180 NavigateToKeyboard(); | 180 NavigateToKeyboard(); |
181 ASSERT_TRUE(catcher.GetNextResult()); | 181 ASSERT_TRUE(catcher.GetNextResult()); |
182 } | 182 } |
183 } | 183 } |
184 #endif | 184 #endif |
OLD | NEW |