OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/signin/signin_promo.h" | 5 #include "chrome/browser/signin/signin_promo.h" |
6 #include "chrome/browser/ui/browser.h" | 6 #include "chrome/browser/ui/browser.h" |
7 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 7 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 private: | 150 private: |
151 virtual void SetUpOnMainThread() OVERRIDE { | 151 virtual void SetUpOnMainThread() OVERRIDE { |
152 content::WebUIControllerFactory::UnregisterFactoryForTesting( | 152 content::WebUIControllerFactory::UnregisterFactoryForTesting( |
153 ChromeWebUIControllerFactory::GetInstance()); | 153 ChromeWebUIControllerFactory::GetInstance()); |
154 test_factory_.reset(new TestChromeWebUIControllerFactory); | 154 test_factory_.reset(new TestChromeWebUIControllerFactory); |
155 content::WebUIControllerFactory::RegisterFactory(test_factory_.get()); | 155 content::WebUIControllerFactory::RegisterFactory(test_factory_.get()); |
156 test_factory_->AddFactoryOverride( | 156 test_factory_->AddFactoryOverride( |
157 GURL(kFooWebUIURL).host(), &foo_provider_); | 157 GURL(kFooWebUIURL).host(), &foo_provider_); |
158 } | 158 } |
159 | 159 |
160 virtual void CleanUpOnMainThread() OVERRIDE { | 160 virtual void TearDownOnMainThread() OVERRIDE { |
161 test_factory_->RemoveFactoryOverride(GURL(kFooWebUIURL).host()); | 161 test_factory_->RemoveFactoryOverride(GURL(kFooWebUIURL).host()); |
162 content::WebUIControllerFactory::UnregisterFactoryForTesting( | 162 content::WebUIControllerFactory::UnregisterFactoryForTesting( |
163 test_factory_.get()); | 163 test_factory_.get()); |
164 test_factory_.reset(); | 164 test_factory_.reset(); |
165 } | 165 } |
166 | 166 |
167 FooWebUIProvider foo_provider_; | 167 FooWebUIProvider foo_provider_; |
168 scoped_ptr<TestChromeWebUIControllerFactory> test_factory_; | 168 scoped_ptr<TestChromeWebUIControllerFactory> test_factory_; |
169 }; | 169 }; |
170 | 170 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 content::WebContents* contents = | 232 content::WebContents* contents = |
233 browser()->tab_strip_model()->GetActiveWebContents(); | 233 browser()->tab_strip_model()->GetActiveWebContents(); |
234 ASSERT_TRUE(content::ExecuteScript( | 234 ASSERT_TRUE(content::ExecuteScript( |
235 contents, "window.location.href = 'chrome://foo'")); | 235 contents, "window.location.href = 'chrome://foo'")); |
236 | 236 |
237 content::TestNavigationObserver navigation_observer(contents, 1); | 237 content::TestNavigationObserver navigation_observer(contents, 1); |
238 navigation_observer.Wait(); | 238 navigation_observer.Wait(); |
239 | 239 |
240 EXPECT_EQ(GURL("about:blank"), contents->GetVisibleURL()); | 240 EXPECT_EQ(GURL("about:blank"), contents->GetVisibleURL()); |
241 } | 241 } |
OLD | NEW |