| 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 <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 EXPECT_TRUE(error); | 554 EXPECT_TRUE(error); |
| 555 EXPECT_FALSE(accept_enabled); | 555 EXPECT_FALSE(accept_enabled); |
| 556 return; | 556 return; |
| 557 } | 557 } |
| 558 | 558 |
| 559 // The Terms of Service URL was valid. Verify that the screen is showing the | 559 // The Terms of Service URL was valid. Verify that the screen is showing the |
| 560 // downloaded Terms of Service and the accept button is enabled. | 560 // downloaded Terms of Service and the accept button is enabled. |
| 561 base::FilePath test_dir; | 561 base::FilePath test_dir; |
| 562 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); | 562 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); |
| 563 std::string terms_of_service; | 563 std::string terms_of_service; |
| 564 ASSERT_TRUE(file_util::ReadFileToString( | 564 ASSERT_TRUE(base::ReadFileToString( |
| 565 test_dir.Append(kExistentTermsOfServicePath), &terms_of_service)); | 565 test_dir.Append(kExistentTermsOfServicePath), &terms_of_service)); |
| 566 EXPECT_EQ(terms_of_service, content); | 566 EXPECT_EQ(terms_of_service, content); |
| 567 EXPECT_FALSE(error); | 567 EXPECT_FALSE(error); |
| 568 EXPECT_TRUE(accept_enabled); | 568 EXPECT_TRUE(accept_enabled); |
| 569 | 569 |
| 570 // Click the accept button. | 570 // Click the accept button. |
| 571 ASSERT_TRUE(content::ExecuteScript(contents, | 571 ASSERT_TRUE(content::ExecuteScript(contents, |
| 572 "$('tos-accept-button').click();")); | 572 "$('tos-accept-button').click();")); |
| 573 | 573 |
| 574 // Wait for the session to start. | 574 // Wait for the session to start. |
| 575 if (!IsSessionStarted()) { | 575 if (!IsSessionStarted()) { |
| 576 content::WindowedNotificationObserver(chrome::NOTIFICATION_SESSION_STARTED, | 576 content::WindowedNotificationObserver(chrome::NOTIFICATION_SESSION_STARTED, |
| 577 base::Bind(IsSessionStarted)).Wait(); | 577 base::Bind(IsSessionStarted)).Wait(); |
| 578 } | 578 } |
| 579 } | 579 } |
| 580 | 580 |
| 581 INSTANTIATE_TEST_CASE_P(TermsOfServiceTestInstance, | 581 INSTANTIATE_TEST_CASE_P(TermsOfServiceTestInstance, |
| 582 TermsOfServiceTest, testing::Bool()); | 582 TermsOfServiceTest, testing::Bool()); |
| 583 | 583 |
| 584 } // namespace policy | 584 } // namespace policy |
| OLD | NEW |