| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_warning_set.h" | 5 #include "chrome/browser/extensions/extension_warning_set.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_global_error_badge.h" | 7 #include "chrome/browser/extensions/extension_global_error_badge.h" |
| 8 #include "chrome/browser/ui/global_error_service.h" | 8 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 9 #include "chrome/browser/ui/global_error_service_factory.h" | 9 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 class MockExtensionWarningSet : public ExtensionWarningSet { | 16 class MockExtensionWarningSet : public ExtensionWarningSet { |
| 17 public: | 17 public: |
| 18 explicit MockExtensionWarningSet(Profile* profile) | 18 explicit MockExtensionWarningSet(Profile* profile) |
| 19 : ExtensionWarningSet(profile) { | 19 : ExtensionWarningSet(profile) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 warnings.SetWarning(warning_1, ext1_id); | 127 warnings.SetWarning(warning_1, ext1_id); |
| 128 testing::Mock::VerifyAndClearExpectations(&warnings); | 128 testing::Mock::VerifyAndClearExpectations(&warnings); |
| 129 EXPECT_FALSE(HasBadge(&profile)); | 129 EXPECT_FALSE(HasBadge(&profile)); |
| 130 | 130 |
| 131 // Set second warning and verify that it shows a badge. | 131 // Set second warning and verify that it shows a badge. |
| 132 EXPECT_CALL(warnings, NotifyWarningsChanged()); | 132 EXPECT_CALL(warnings, NotifyWarningsChanged()); |
| 133 warnings.SetWarning(warning_2, ext2_id); | 133 warnings.SetWarning(warning_2, ext2_id); |
| 134 testing::Mock::VerifyAndClearExpectations(&warnings); | 134 testing::Mock::VerifyAndClearExpectations(&warnings); |
| 135 EXPECT_TRUE(HasBadge(&profile)); | 135 EXPECT_TRUE(HasBadge(&profile)); |
| 136 } | 136 } |
| OLD | NEW |