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