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

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

Issue 1554583002: Revert of Change extension icon load errors to warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge issues Created 4 years, 11 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_action_manager.h" 5 #include "chrome/browser/extensions/extension_action_manager.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "chrome/browser/extensions/extension_action.h" 8 #include "chrome/browser/extensions/extension_action.h"
9 #include "chrome/test/base/testing_profile.h" 9 #include "chrome/test/base/testing_profile.h"
10 #include "content/public/test/test_browser_thread_bundle.h" 10 #include "content/public/test/test_browser_thread_bundle.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 std::string id = base::IntToString(curr_id_++); 77 std::string id = base::IntToString(curr_id_++);
78 scoped_refptr<Extension> extension = 78 scoped_refptr<Extension> extension =
79 ExtensionBuilder() 79 ExtensionBuilder()
80 .SetManifest(std::move( 80 .SetManifest(std::move(
81 DictionaryBuilder() 81 DictionaryBuilder()
82 .Set("version", "1") 82 .Set("version", "1")
83 .Set("manifest_version", 2) 83 .Set("manifest_version", 2)
84 .Set("icons", std::move(extension_icons)) 84 .Set("icons", std::move(extension_icons))
85 .Set(action_type, std::move(action)) 85 .Set(action_type, std::move(action))
86 .Set("name", std::string("Test Extension").append(id)))) 86 .Set("name", std::string("Test Extension").append(id))))
87 .SetLocation(Manifest::UNPACKED)
88 .SetID(id) 87 .SetID(id)
89 .Build(); 88 .Build();
90 registry_->AddEnabled(extension); 89 registry_->AddEnabled(extension);
91 return extension; 90 return extension;
92 } 91 }
93 92
94 bool ExtensionActionManagerTest::TitlesMatch(const Extension& extension, 93 bool ExtensionActionManagerTest::TitlesMatch(const Extension& extension,
95 const ExtensionAction& action) { 94 const ExtensionAction& action) {
96 return action.GetTitle(ExtensionAction::kDefaultTabId) == extension.name(); 95 return action.GetTitle(ExtensionAction::kDefaultTabId) == extension.name();
97 } 96 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 manager()->GetBestFitAction(*extension.get(), ActionInfo::TYPE_BROWSER); 221 manager()->GetBestFitAction(*extension.get(), ActionInfo::TYPE_BROWSER);
223 222
224 // Now these values match because |extension| does not have page action 223 // Now these values match because |extension| does not have page action
225 // defaults. 224 // defaults.
226 ASSERT_TRUE(TitlesMatch(*extension.get(), *action)); 225 ASSERT_TRUE(TitlesMatch(*extension.get(), *action));
227 ASSERT_TRUE(IconsMatch(*extension.get(), 48, *action, 38)); 226 ASSERT_TRUE(IconsMatch(*extension.get(), 48, *action, 38));
228 } 227 }
229 228
230 } // namespace 229 } // namespace
231 } // namespace extensions 230 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698