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

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_actions_model_unittest.cc

Issue 1739183003: Make extensions::DictionaryBuilder and extensions::ListValue unmovable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 EXPECT_EQ(browser_action_a()->id(), GetActionIdAtIndex(0)); 1270 EXPECT_EQ(browser_action_a()->id(), GetActionIdAtIndex(0));
1271 EXPECT_EQ(browser_action_b()->id(), GetActionIdAtIndex(1)); 1271 EXPECT_EQ(browser_action_b()->id(), GetActionIdAtIndex(1));
1272 EXPECT_EQ(browser_action_c()->id(), GetActionIdAtIndex(2)); 1272 EXPECT_EQ(browser_action_c()->id(), GetActionIdAtIndex(2));
1273 1273
1274 const char kName[] = "component"; 1274 const char kName[] = "component";
1275 extensions::DictionaryBuilder manifest; 1275 extensions::DictionaryBuilder manifest;
1276 manifest.Set("name", kName) 1276 manifest.Set("name", kName)
1277 .Set("description", "An extension") 1277 .Set("description", "An extension")
1278 .Set("manifest_version", 2) 1278 .Set("manifest_version", 2)
1279 .Set("version", "1.0.0") 1279 .Set("version", "1.0.0")
1280 .Set("browser_action", extensions::DictionaryBuilder()); 1280 .Set("browser_action", extensions::DictionaryBuilder().Build());
1281 scoped_refptr<const extensions::Extension> component_extension = 1281 scoped_refptr<const extensions::Extension> component_extension =
1282 extensions::ExtensionBuilder() 1282 extensions::ExtensionBuilder()
1283 .SetManifest(std::move(manifest)) 1283 .SetManifest(manifest.Build())
1284 .SetID(crx_file::id_util::GenerateId(kName)) 1284 .SetID(crx_file::id_util::GenerateId(kName))
1285 .SetLocation(extensions::Manifest::COMPONENT) 1285 .SetLocation(extensions::Manifest::COMPONENT)
1286 .Build(); 1286 .Build();
1287 service()->AddExtension(component_extension.get()); 1287 service()->AddExtension(component_extension.get());
1288 1288
1289 EXPECT_EQ(component_extension.get()->id(), GetActionIdAtIndex(0)); 1289 EXPECT_EQ(component_extension.get()->id(), GetActionIdAtIndex(0));
1290 EXPECT_EQ(browser_action_a()->id(), GetActionIdAtIndex(1)); 1290 EXPECT_EQ(browser_action_a()->id(), GetActionIdAtIndex(1));
1291 EXPECT_EQ(browser_action_b()->id(), GetActionIdAtIndex(2)); 1291 EXPECT_EQ(browser_action_b()->id(), GetActionIdAtIndex(2));
1292 EXPECT_EQ(browser_action_c()->id(), GetActionIdAtIndex(3)); 1292 EXPECT_EQ(browser_action_c()->id(), GetActionIdAtIndex(3));
1293 } 1293 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 } 1492 }
1493 1493
1494 TEST_F(ToolbarActionsModelUnitTest, 1494 TEST_F(ToolbarActionsModelUnitTest,
1495 MigrationToExtensionWithoutExtensionActionRedesign) { 1495 MigrationToExtensionWithoutExtensionActionRedesign) {
1496 InitForMigrationTest(MigrationStatus::FEATURE_DISABLED_WITH_PREF_TRUE); 1496 InitForMigrationTest(MigrationStatus::FEATURE_DISABLED_WITH_PREF_TRUE);
1497 1497
1498 // Initialization re-enables the extension. 1498 // Initialization re-enables the extension.
1499 EXPECT_EQ(1u, num_toolbar_items()); 1499 EXPECT_EQ(1u, num_toolbar_items());
1500 EXPECT_EQ(browser_action_migrated()->id(), GetActionIdAtIndex(0u)); 1500 EXPECT_EQ(browser_action_migrated()->id(), GetActionIdAtIndex(0u));
1501 } 1501 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698