OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1916 // Verify that the locale and keyboard layout have been applied. | 1916 // Verify that the locale and keyboard layout have been applied. |
1917 EXPECT_EQ(kPublicSessionLocale, g_browser_process->GetApplicationLocale()); | 1917 EXPECT_EQ(kPublicSessionLocale, g_browser_process->GetApplicationLocale()); |
1918 EXPECT_EQ(l10n_util::GetLanguage(kPublicSessionLocale), | 1918 EXPECT_EQ(l10n_util::GetLanguage(kPublicSessionLocale), |
1919 icu::Locale::getDefault().getLanguage()); | 1919 icu::Locale::getDefault().getLanguage()); |
1920 EXPECT_EQ(public_session_input_method_id_, | 1920 EXPECT_EQ(public_session_input_method_id_, |
1921 chromeos::input_method::InputMethodManager::Get() | 1921 chromeos::input_method::InputMethodManager::Get() |
1922 ->GetActiveIMEState() | 1922 ->GetActiveIMEState() |
1923 ->GetCurrentInputMethod() | 1923 ->GetCurrentInputMethod() |
1924 .id()); | 1924 .id()); |
1925 | 1925 |
| 1926 // Wait for 'tos-accept-button' to become enabled. |
| 1927 done = false; |
| 1928 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
| 1929 contents_, |
| 1930 "var screenElement = document.getElementById('tos-accept-button');" |
| 1931 "function SendReplyIfAcceptEnabled() {" |
| 1932 " if ($('tos-accept-button').disabled)" |
| 1933 " return false;" |
| 1934 " domAutomationController.send(true);" |
| 1935 " observer.disconnect();" |
| 1936 " return true;" |
| 1937 "}" |
| 1938 "var observer = new MutationObserver(SendReplyIfAcceptEnabled);" |
| 1939 "if (!SendReplyIfAcceptEnabled()) {" |
| 1940 " var options = { attributes: true };" |
| 1941 " observer.observe(screenElement, options);" |
| 1942 "}", |
| 1943 &done)); |
| 1944 |
1926 // Click the accept button. | 1945 // Click the accept button. |
1927 ASSERT_TRUE(content::ExecuteScript(contents_, | 1946 ASSERT_TRUE(content::ExecuteScript(contents_, |
1928 "$('tos-accept-button').click();")); | 1947 "$('tos-accept-button').click();")); |
1929 | 1948 |
1930 WaitForSessionStart(); | 1949 WaitForSessionStart(); |
1931 | 1950 |
1932 // Verify that the locale and keyboard layout are still in force. | 1951 // Verify that the locale and keyboard layout are still in force. |
1933 EXPECT_EQ(kPublicSessionLocale, g_browser_process->GetApplicationLocale()); | 1952 EXPECT_EQ(kPublicSessionLocale, g_browser_process->GetApplicationLocale()); |
1934 EXPECT_EQ(l10n_util::GetLanguage(kPublicSessionLocale), | 1953 EXPECT_EQ(l10n_util::GetLanguage(kPublicSessionLocale), |
1935 icu::Locale::getDefault().getLanguage()); | 1954 icu::Locale::getDefault().getLanguage()); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 ASSERT_TRUE(content::ExecuteScript(contents_, | 2084 ASSERT_TRUE(content::ExecuteScript(contents_, |
2066 "$('tos-accept-button').click();")); | 2085 "$('tos-accept-button').click();")); |
2067 | 2086 |
2068 WaitForSessionStart(); | 2087 WaitForSessionStart(); |
2069 } | 2088 } |
2070 | 2089 |
2071 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance, | 2090 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance, |
2072 TermsOfServiceDownloadTest, testing::Bool()); | 2091 TermsOfServiceDownloadTest, testing::Bool()); |
2073 | 2092 |
2074 } // namespace policy | 2093 } // namespace policy |
OLD | NEW |