| 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_badge_service.h" | 5 #include "chrome/browser/extensions/extension_warning_badge_service.h" |
| 6 | 6 |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/extensions/extension_warning_set.h" | |
| 9 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/global_error/global_error_service.h" | 9 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 11 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 10 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 12 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" |
| 12 #include "extensions/browser/extension_warning_set.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 class TestExtensionWarningSet : public ExtensionWarningService { | 19 class TestExtensionWarningSet : public ExtensionWarningService { |
| 20 public: | 20 public: |
| 21 explicit TestExtensionWarningSet(Profile* profile) | 21 explicit TestExtensionWarningSet(Profile* profile) |
| 22 : ExtensionWarningService(profile) { | 22 : ExtensionWarningService(profile) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 EXPECT_FALSE(HasBadge(&profile)); | 86 EXPECT_FALSE(HasBadge(&profile)); |
| 87 | 87 |
| 88 // Set second warning and verify that it shows a badge. | 88 // Set second warning and verify that it shows a badge. |
| 89 warnings.AddWarning(ExtensionWarning::CreateNetworkConflictWarning(ext2_id)); | 89 warnings.AddWarning(ExtensionWarning::CreateNetworkConflictWarning(ext2_id)); |
| 90 EXPECT_TRUE(HasBadge(&profile)); | 90 EXPECT_TRUE(HasBadge(&profile)); |
| 91 | 91 |
| 92 warnings.RemoveObserver(&badge_service); | 92 warnings.RemoveObserver(&badge_service); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace extensions | 95 } // namespace extensions |
| OLD | NEW |