| 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/bidi_checker_web_ui_test.h" | 5 #include "chrome/browser/ui/webui/bidi_checker_web_ui_test.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" |
| 8 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 9 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 11 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
| 12 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
| 13 #include "base/time.h" | 14 #include "base/time.h" |
| 14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 15 #include "base/values.h" | 16 #include "base/values.h" |
| 16 #include "chrome/browser/autofill/autofill_common_test.h" | 17 #include "chrome/browser/autofill/autofill_common_test.h" |
| 17 #include "chrome/browser/autofill/autofill_profile.h" | 18 #include "chrome/browser/autofill/autofill_profile.h" |
| 18 #include "chrome/browser/autofill/personal_data_manager.h" | 19 #include "chrome/browser/autofill/personal_data_manager.h" |
| 19 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 20 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 20 #include "chrome/browser/history/history.h" | 21 #include "chrome/browser/history/history.h" |
| 21 #include "chrome/browser/history/history_service_factory.h" | 22 #include "chrome/browser/history/history_service_factory.h" |
| 22 #include "chrome/browser/prefs/pref_service.h" | 23 #include "chrome/browser/prefs/pref_service.h" |
| 23 #include "chrome/browser/prefs/session_startup_pref.h" | 24 #include "chrome/browser/prefs/session_startup_pref.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 27 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 27 #include "chrome/test/base/ui_test_utils.h" | 29 #include "chrome/test/base/ui_test_utils.h" |
| 28 #include "content/public/browser/browser_thread.h" | 30 #include "content/public/browser/browser_thread.h" |
| 29 #include "ui/base/resource/resource_bundle.h" | 31 #include "ui/base/resource/resource_bundle.h" |
| 30 | 32 |
| 31 #if defined(TOOLKIT_GTK) | 33 #if defined(TOOLKIT_GTK) |
| 32 #include <gtk/gtk.h> | 34 #include <gtk/gtk.h> |
| 33 #endif | 35 #endif |
| 34 | 36 |
| 35 static const FilePath::CharType* kWebUIBidiCheckerLibraryJS = | 37 static const FilePath::CharType* kWebUIBidiCheckerLibraryJS = |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 content::RunMessageLoop(); | 76 content::RunMessageLoop(); |
| 75 } | 77 } |
| 76 | 78 |
| 77 } // namespace | 79 } // namespace |
| 78 | 80 |
| 79 static const FilePath::CharType* kBidiCheckerTestsJS = | 81 static const FilePath::CharType* kBidiCheckerTestsJS = |
| 80 FILE_PATH_LITERAL("bidichecker_tests.js"); | 82 FILE_PATH_LITERAL("bidichecker_tests.js"); |
| 81 | 83 |
| 82 WebUIBidiCheckerBrowserTest::~WebUIBidiCheckerBrowserTest() {} | 84 WebUIBidiCheckerBrowserTest::~WebUIBidiCheckerBrowserTest() {} |
| 83 | 85 |
| 86 void WebUIBidiCheckerBrowserTest::SetUp() { |
| 87 // The new web-based sign in flow does not use webui. However, the old |
| 88 // /CliengLogin flow does. Force this test to always run the old flow to make |
| 89 // sure it does not regress. |
| 90 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 91 switches::kUseClientLoginSigninFlow)) { |
| 92 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 93 switches::kUseClientLoginSigninFlow); |
| 94 } |
| 95 |
| 96 WebUIBrowserTest::SetUp(); |
| 97 } |
| 98 |
| 84 WebUIBidiCheckerBrowserTest::WebUIBidiCheckerBrowserTest() {} | 99 WebUIBidiCheckerBrowserTest::WebUIBidiCheckerBrowserTest() {} |
| 85 | 100 |
| 86 void WebUIBidiCheckerBrowserTest::SetUpInProcessBrowserTestFixture() { | 101 void WebUIBidiCheckerBrowserTest::SetUpInProcessBrowserTestFixture() { |
| 87 WebUIBrowserTest::SetUpInProcessBrowserTestFixture(); | 102 WebUIBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 88 WebUIBrowserTest::AddLibrary(WebUIBidiCheckerLibraryJSPath()); | 103 WebUIBrowserTest::AddLibrary(WebUIBidiCheckerLibraryJSPath()); |
| 89 WebUIBrowserTest::AddLibrary(FilePath(kBidiCheckerTestsJS)); | 104 WebUIBrowserTest::AddLibrary(FilePath(kBidiCheckerTestsJS)); |
| 90 } | 105 } |
| 91 | 106 |
| 92 void WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage( | 107 void WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage( |
| 93 const std::string& page_url, bool is_rtl) { | 108 const std::string& page_url, bool is_rtl) { |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 // chrome://history-frame | 768 // chrome://history-frame |
| 754 //============================== | 769 //============================== |
| 755 | 770 |
| 756 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestHistoryFrame) { | 771 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestHistoryFrame) { |
| 757 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL); | 772 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL); |
| 758 } | 773 } |
| 759 | 774 |
| 760 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestHistoryFrame) { | 775 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestHistoryFrame) { |
| 761 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL); | 776 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL); |
| 762 } | 777 } |
| OLD | NEW |