Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Side by Side Diff: chrome/browser/chromeos/policy/device_local_account_browsertest.cc

Issue 2549373005: cros: Refactor of BaseScreen::GetName to BaseScreen::screen_id. (Closed)
Patch Set: Nits Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/chromeos/policy/device_local_account.h" 5 #include "chrome/browser/chromeos/policy/device_local_account.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 // observer. 2149 // observer.
2150 login_wait_run_loop.Run(); 2150 login_wait_run_loop.Run();
2151 controller->set_login_status_consumer(NULL); 2151 controller->set_login_status_consumer(NULL);
2152 2152
2153 // Verify that the Terms of Service screen is being shown. 2153 // Verify that the Terms of Service screen is being shown.
2154 chromeos::WizardController* wizard_controller = 2154 chromeos::WizardController* wizard_controller =
2155 chromeos::WizardController::default_controller(); 2155 chromeos::WizardController::default_controller();
2156 ASSERT_TRUE(wizard_controller); 2156 ASSERT_TRUE(wizard_controller);
2157 ASSERT_TRUE(wizard_controller->current_screen()); 2157 ASSERT_TRUE(wizard_controller->current_screen());
2158 EXPECT_EQ(chromeos::WizardController::kTermsOfServiceScreenName, 2158 EXPECT_EQ(chromeos::WizardController::kTermsOfServiceScreenName,
2159 wizard_controller->current_screen()->GetName()); 2159 wizard_controller->current_screen()->screen_id());
2160 2160
2161 // Wait for the Terms of Service to finish downloading. 2161 // Wait for the Terms of Service to finish downloading.
2162 bool done = false; 2162 bool done = false;
2163 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(contents_, 2163 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(contents_,
2164 "var screenElement = document.getElementById('terms-of-service');" 2164 "var screenElement = document.getElementById('terms-of-service');"
2165 "function SendReplyIfDownloadDone() {" 2165 "function SendReplyIfDownloadDone() {"
2166 " if (screenElement.classList.contains('tos-loading'))" 2166 " if (screenElement.classList.contains('tos-loading'))"
2167 " return false;" 2167 " return false;"
2168 " domAutomationController.send(true);" 2168 " domAutomationController.send(true);"
2169 " observer.disconnect();" 2169 " observer.disconnect();"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 controller->set_login_status_consumer(&login_status_consumer); 2356 controller->set_login_status_consumer(&login_status_consumer);
2357 login_wait_run_loop.Run(); 2357 login_wait_run_loop.Run();
2358 controller->set_login_status_consumer(NULL); 2358 controller->set_login_status_consumer(NULL);
2359 2359
2360 // Verify that the Terms of Service screen is being shown. 2360 // Verify that the Terms of Service screen is being shown.
2361 chromeos::WizardController* wizard_controller = 2361 chromeos::WizardController* wizard_controller =
2362 chromeos::WizardController::default_controller(); 2362 chromeos::WizardController::default_controller();
2363 ASSERT_TRUE(wizard_controller); 2363 ASSERT_TRUE(wizard_controller);
2364 ASSERT_TRUE(wizard_controller->current_screen()); 2364 ASSERT_TRUE(wizard_controller->current_screen());
2365 EXPECT_EQ(chromeos::WizardController::kTermsOfServiceScreenName, 2365 EXPECT_EQ(chromeos::WizardController::kTermsOfServiceScreenName,
2366 wizard_controller->current_screen()->GetName()); 2366 wizard_controller->current_screen()->screen_id());
2367 2367
2368 // Wait for the Terms of Service to finish downloading, then get the status of 2368 // Wait for the Terms of Service to finish downloading, then get the status of
2369 // the screen's UI elements. 2369 // the screen's UI elements.
2370 std::string json; 2370 std::string json;
2371 ASSERT_TRUE(content::ExecuteScriptAndExtractString(contents_, 2371 ASSERT_TRUE(content::ExecuteScriptAndExtractString(contents_,
2372 "var screenElement = document.getElementById('terms-of-service');" 2372 "var screenElement = document.getElementById('terms-of-service');"
2373 "function SendReplyIfDownloadDone() {" 2373 "function SendReplyIfDownloadDone() {"
2374 " if (screenElement.classList.contains('tos-loading'))" 2374 " if (screenElement.classList.contains('tos-loading'))"
2375 " return false;" 2375 " return false;"
2376 " var status = {};" 2376 " var status = {};"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
2448 ASSERT_TRUE(content::ExecuteScript(contents_, 2448 ASSERT_TRUE(content::ExecuteScript(contents_,
2449 "$('tos-accept-button').click();")); 2449 "$('tos-accept-button').click();"));
2450 2450
2451 WaitForSessionStart(); 2451 WaitForSessionStart();
2452 } 2452 }
2453 2453
2454 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance, 2454 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance,
2455 TermsOfServiceDownloadTest, testing::Bool()); 2455 TermsOfServiceDownloadTest, testing::Bool());
2456 2456
2457 } // namespace policy 2457 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698