OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/web_resource/eula_accepted_notifier.h" | 5 #include "components/web_resource/eula_accepted_notifier.h" |
6 | 6 |
| 7 #include "base/macros.h" |
7 #include "base/prefs/pref_registry_simple.h" | 8 #include "base/prefs/pref_registry_simple.h" |
8 #include "base/prefs/testing_pref_service.h" | 9 #include "base/prefs/testing_pref_service.h" |
9 #include "components/web_resource/web_resource_pref_names.h" | 10 #include "components/web_resource/web_resource_pref_names.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 | 12 |
12 namespace web_resource { | 13 namespace web_resource { |
13 | 14 |
14 class EulaAcceptedNotifierTest : public testing::Test, | 15 class EulaAcceptedNotifierTest : public testing::Test, |
15 public EulaAcceptedNotifier::Observer { | 16 public EulaAcceptedNotifier::Observer { |
16 public: | 17 public: |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 TEST_F(EulaAcceptedNotifierTest, EulaNotInitiallyAccepted) { | 71 TEST_F(EulaAcceptedNotifierTest, EulaNotInitiallyAccepted) { |
71 EXPECT_FALSE(notifier()->IsEulaAccepted()); | 72 EXPECT_FALSE(notifier()->IsEulaAccepted()); |
72 SetEulaAcceptedPref(); | 73 SetEulaAcceptedPref(); |
73 EXPECT_TRUE(notifier()->IsEulaAccepted()); | 74 EXPECT_TRUE(notifier()->IsEulaAccepted()); |
74 EXPECT_TRUE(eula_accepted_called()); | 75 EXPECT_TRUE(eula_accepted_called()); |
75 // Call it a second time, to ensure the answer doesn't change. | 76 // Call it a second time, to ensure the answer doesn't change. |
76 EXPECT_TRUE(notifier()->IsEulaAccepted()); | 77 EXPECT_TRUE(notifier()->IsEulaAccepted()); |
77 } | 78 } |
78 | 79 |
79 } // namespace web_resource | 80 } // namespace web_resource |
OLD | NEW |