| OLD | NEW |
| 1 // Copyright (c) 2012 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/ui/webui/options/options_ui_browsertest.h" | 5 #include "chrome/browser/ui/webui/options/options_ui_browsertest.h" |
| 6 | 6 |
| 7 #include "base/scoped_observer.h" | 7 #include "base/scoped_observer.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
| 12 #include "chrome/browser/signin/account_tracker_service_factory.h" | 12 #include "chrome/browser/signin/account_tracker_service_factory.h" |
| 13 #include "chrome/browser/signin/signin_manager_factory.h" | 13 #include "chrome/browser/signin/signin_manager_factory.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/chrome_pages.h" | 15 #include "chrome/browser/ui/chrome_pages.h" |
| 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 17 #include "chrome/browser/ui/webui/options/options_ui.h" | 17 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 18 #include "chrome/browser/ui/webui/uber/uber_ui.h" | 18 #include "chrome/browser/ui/webui/uber/uber_ui.h" |
| 19 #include "chrome/common/chrome_features.h" | |
| 20 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 21 #include "chrome/grit/generated_resources.h" | 20 #include "chrome/grit/generated_resources.h" |
| 22 #include "chrome/test/base/ui_test_utils.h" | 21 #include "chrome/test/base/ui_test_utils.h" |
| 23 #include "components/prefs/pref_service.h" | 22 #include "components/prefs/pref_service.h" |
| 24 #include "components/signin/core/browser/account_tracker_service.h" | 23 #include "components/signin/core/browser/account_tracker_service.h" |
| 25 #include "components/signin/core/browser/signin_manager.h" | 24 #include "components/signin/core/browser/signin_manager.h" |
| 26 #include "components/strings/grit/components_strings.h" | 25 #include "components/strings/grit/components_strings.h" |
| 27 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
| 28 #include "content/public/browser/render_frame_host.h" | 27 #include "content/public/browser/render_frame_host.h" |
| 29 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 bool FrameHasSettingsSourceHost(content::RenderFrameHost* frame) { | 100 bool FrameHasSettingsSourceHost(content::RenderFrameHost* frame) { |
| 102 return frame->GetLastCommittedURL().DomainIs( | 101 return frame->GetLastCommittedURL().DomainIs( |
| 103 chrome::kChromeUISettingsFrameHost); | 102 chrome::kChromeUISettingsFrameHost); |
| 104 } | 103 } |
| 105 | 104 |
| 106 } // namespace | 105 } // namespace |
| 107 | 106 |
| 108 OptionsUIBrowserTest::OptionsUIBrowserTest() { | 107 OptionsUIBrowserTest::OptionsUIBrowserTest() { |
| 109 } | 108 } |
| 110 | 109 |
| 111 void OptionsUIBrowserTest::SetUpInProcessBrowserTestFixture() { | |
| 112 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | |
| 113 disable_md_settings_.InitAndDisableFeature(features::kMaterialDesignSettings); | |
| 114 } | |
| 115 | |
| 116 void OptionsUIBrowserTest::NavigateToSettings() { | 110 void OptionsUIBrowserTest::NavigateToSettings() { |
| 117 NavigateToSettingsSubpage(""); | 111 NavigateToSettingsSubpage(""); |
| 118 } | 112 } |
| 119 | 113 |
| 120 void OptionsUIBrowserTest::NavigateToSettingsSubpage( | 114 void OptionsUIBrowserTest::NavigateToSettingsSubpage( |
| 121 const std::string& sub_page) { | 115 const std::string& sub_page) { |
| 122 const GURL& url = chrome::GetSettingsUrl(sub_page); | 116 const GURL& url = chrome::GetSettingsUrl(sub_page); |
| 123 ui_test_utils::NavigateToURLWithDisposition( | 117 ui_test_utils::NavigateToURLWithDisposition( |
| 124 browser(), url, WindowOpenDisposition::CURRENT_TAB, 0); | 118 browser(), url, WindowOpenDisposition::CURRENT_TAB, 0); |
| 125 | 119 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 run_loop.Run(); | 329 run_loop.Run(); |
| 336 | 330 |
| 337 // Verify that the settings page has updated and lists two profiles. | 331 // Verify that the settings page has updated and lists two profiles. |
| 338 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( | 332 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( |
| 339 contents, javascript, &profiles)); | 333 contents, javascript, &profiles)); |
| 340 EXPECT_EQ(2, profiles); | 334 EXPECT_EQ(2, profiles); |
| 341 } | 335 } |
| 342 #endif | 336 #endif |
| 343 | 337 |
| 344 } // namespace options | 338 } // namespace options |
| OLD | NEW |