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

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

Issue 1547413002: Reland of Change extension icon load errors to warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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)
87 .SetID(id) 88 .SetID(id)
88 .Build(); 89 .Build();
89 registry_->AddEnabled(extension); 90 registry_->AddEnabled(extension);
90 return extension; 91 return extension;
91 } 92 }
92 93
93 bool ExtensionActionManagerTest::TitlesMatch(const Extension& extension, 94 bool ExtensionActionManagerTest::TitlesMatch(const Extension& extension,
94 const ExtensionAction& action) { 95 const ExtensionAction& action) {
95 return action.GetTitle(ExtensionAction::kDefaultTabId) == extension.name(); 96 return action.GetTitle(ExtensionAction::kDefaultTabId) == extension.name();
96 } 97 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 manager()->GetBestFitAction(*extension.get(), ActionInfo::TYPE_BROWSER); 222 manager()->GetBestFitAction(*extension.get(), ActionInfo::TYPE_BROWSER);
222 223
223 // Now these values match because |extension| does not have page action 224 // Now these values match because |extension| does not have page action
224 // defaults. 225 // defaults.
225 ASSERT_TRUE(TitlesMatch(*extension.get(), *action)); 226 ASSERT_TRUE(TitlesMatch(*extension.get(), *action));
226 ASSERT_TRUE(IconsMatch(*extension.get(), 48, *action, 38)); 227 ASSERT_TRUE(IconsMatch(*extension.get(), 48, *action, 38));
227 } 228 }
228 229
229 } // namespace 230 } // namespace
230 } // namespace extensions 231 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698