OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_list.h" | 5 #include "chrome/browser/browser_list.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chrome/browser/extensions/extension_dom_ui.h" | 7 #include "chrome/browser/extensions/extension_dom_ui.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 EXPECT_TRUE(tab->controller().GetActiveEntry()->url(). | 65 EXPECT_TRUE(tab->controller().GetActiveEntry()->url(). |
66 SchemeIs(chrome::kExtensionScheme)); | 66 SchemeIs(chrome::kExtensionScheme)); |
67 | 67 |
68 ASSERT_TRUE(catcher.GetNextResult()); | 68 ASSERT_TRUE(catcher.GetNextResult()); |
69 } | 69 } |
70 | 70 |
71 // TODO(erikkay) Load a second extension with the same override. | 71 // TODO(erikkay) Load a second extension with the same override. |
72 // Verify behavior, then unload the first and verify behavior, etc. | 72 // Verify behavior, then unload the first and verify behavior, etc. |
73 } | 73 } |
74 | 74 |
75 IN_PROC_BROWSER_TEST_F(ExtensionOverrideTest, OverrideNewtabIncognito) { | 75 #if defined(OS_MACOSX) |
| 76 // Hangy: http://crbug.com/70511 |
| 77 #define MAYBE_OverrideNewtabIncognito DISABLED_OverrideNewtabIncognito |
| 78 #else |
| 79 #define MAYBE_OverrideNewtabIncognito OverrideNewtabIncognito |
| 80 #endif |
| 81 IN_PROC_BROWSER_TEST_F(ExtensionOverrideTest, MAYBE_OverrideNewtabIncognito) { |
76 ASSERT_TRUE(RunExtensionTest("override/newtab")) << message_; | 82 ASSERT_TRUE(RunExtensionTest("override/newtab")) << message_; |
77 | 83 |
78 // Navigate an incognito tab to the new tab page. We should get the actual | 84 // Navigate an incognito tab to the new tab page. We should get the actual |
79 // new tab page because we can't load chrome-extension URLs in incognito. | 85 // new tab page because we can't load chrome-extension URLs in incognito. |
80 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), | 86 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), |
81 GURL("chrome://newtab/")); | 87 GURL("chrome://newtab/")); |
82 Browser* otr_browser = BrowserList::FindBrowserWithType( | 88 Browser* otr_browser = BrowserList::FindBrowserWithType( |
83 browser()->profile()->GetOffTheRecordProfile(), Browser::TYPE_NORMAL, | 89 browser()->profile()->GetOffTheRecordProfile(), Browser::TYPE_NORMAL, |
84 false); | 90 false); |
85 TabContents* tab = otr_browser->GetSelectedTabContents(); | 91 TabContents* tab = otr_browser->GetSelectedTabContents(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 const ExtensionList *extensions = | 169 const ExtensionList *extensions = |
164 browser()->profile()->GetExtensionService()->extensions(); | 170 browser()->profile()->GetExtensionService()->extensions(); |
165 UnloadExtension((*extensions->rbegin())->id()); | 171 UnloadExtension((*extensions->rbegin())->id()); |
166 { | 172 { |
167 ResultCatcher catcher; | 173 ResultCatcher catcher; |
168 NavigateToKeyboard(); | 174 NavigateToKeyboard(); |
169 ASSERT_TRUE(catcher.GetNextResult()); | 175 ASSERT_TRUE(catcher.GetNextResult()); |
170 } | 176 } |
171 } | 177 } |
172 #endif | 178 #endif |
OLD | NEW |