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