Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Side by Side Diff: chrome/browser/extensions/extension_warning_badge_service_unittest.cc

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, nit Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/global_error/global_error_service.h" 9 #include "chrome/browser/ui/global_error/global_error_service.h"
10 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 10 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 WarningService* warning_service_; 46 WarningService* warning_service_;
47 }; 47 };
48 48
49 bool HasBadge(Profile* profile) { 49 bool HasBadge(Profile* profile) {
50 GlobalErrorService* service = 50 GlobalErrorService* service =
51 GlobalErrorServiceFactory::GetForProfile(profile); 51 GlobalErrorServiceFactory::GetForProfile(profile);
52 return service->GetGlobalErrorByMenuItemCommandID(IDC_EXTENSION_ERRORS) != 52 return service->GetGlobalErrorByMenuItemCommandID(IDC_EXTENSION_ERRORS) !=
53 NULL; 53 NULL;
54 } 54 }
55 55
56 const char* ext1_id = "extension1"; 56 const char ext1_id[] = "extension1";
57 const char* ext2_id = "extension2"; 57 const char ext2_id[] = "extension2";
58 58
59 } // namespace 59 } // namespace
60 60
61 // Check that no badge appears if it has been suppressed for a specific 61 // Check that no badge appears if it has been suppressed for a specific
62 // warning. 62 // warning.
63 TEST(ExtensionWarningBadgeServiceTest, SuppressBadgeForCurrentWarnings) { 63 TEST(ExtensionWarningBadgeServiceTest, SuppressBadgeForCurrentWarnings) {
64 TestingProfile profile; 64 TestingProfile profile;
65 TestExtensionWarningSet warnings(&profile); 65 TestExtensionWarningSet warnings(&profile);
66 TestExtensionWarningBadgeService badge_service(&profile, &warnings); 66 TestExtensionWarningBadgeService badge_service(&profile, &warnings);
67 warnings.AddObserver(&badge_service); 67 warnings.AddObserver(&badge_service);
(...skipping 17 matching lines...) Expand all
85 EXPECT_FALSE(HasBadge(&profile)); 85 EXPECT_FALSE(HasBadge(&profile));
86 86
87 // Set second warning and verify that it shows a badge. 87 // Set second warning and verify that it shows a badge.
88 warnings.AddWarning(Warning::CreateNetworkConflictWarning(ext2_id)); 88 warnings.AddWarning(Warning::CreateNetworkConflictWarning(ext2_id));
89 EXPECT_TRUE(HasBadge(&profile)); 89 EXPECT_TRUE(HasBadge(&profile));
90 90
91 warnings.RemoveObserver(&badge_service); 91 warnings.RemoveObserver(&badge_service);
92 } 92 }
93 93
94 } // namespace extensions 94 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_util.cc ('k') | chrome/browser/extensions/external_component_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698