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

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

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_gcm_app_handler.h" 5 #include "chrome/browser/extensions/extension_gcm_app_handler.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 282
283 waiter_.PumpUILoop(); 283 waiter_.PumpUILoop();
284 } 284 }
285 285
286 // Returns a barebones test extension. 286 // Returns a barebones test extension.
287 scoped_refptr<Extension> CreateExtension() { 287 scoped_refptr<Extension> CreateExtension() {
288 base::DictionaryValue manifest; 288 base::DictionaryValue manifest;
289 manifest.SetString(manifest_keys::kVersion, "1.0.0.0"); 289 manifest.SetString(manifest_keys::kVersion, "1.0.0.0");
290 manifest.SetString(manifest_keys::kName, kTestExtensionName); 290 manifest.SetString(manifest_keys::kName, kTestExtensionName);
291 base::ListValue* permission_list = new base::ListValue; 291 base::ListValue* permission_list = new base::ListValue;
292 permission_list->Append(new base::StringValue("gcm")); 292 permission_list->AppendString("gcm");
293 manifest.Set(manifest_keys::kPermissions, permission_list); 293 manifest.Set(manifest_keys::kPermissions, permission_list);
294 294
295 std::string error; 295 std::string error;
296 scoped_refptr<Extension> extension = Extension::Create( 296 scoped_refptr<Extension> extension = Extension::Create(
297 temp_dir_.path(), 297 temp_dir_.path(),
298 Manifest::UNPACKED, 298 Manifest::UNPACKED,
299 manifest, 299 manifest,
300 Extension::NO_FLAGS, 300 Extension::NO_FLAGS,
301 "ldnnhddmnhbkjipkidpdiheffobcpfmf", 301 "ldnnhddmnhbkjipkidpdiheffobcpfmf",
302 &error); 302 &error);
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 488
489 // App handler is removed when the extension is updated to the version that 489 // App handler is removed when the extension is updated to the version that
490 // has GCM permission removed. 490 // has GCM permission removed.
491 UpdateExtension(extension.get(), "good2.crx"); 491 UpdateExtension(extension.get(), "good2.crx");
492 waiter()->PumpUILoop(); 492 waiter()->PumpUILoop();
493 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero()); 493 EXPECT_TRUE(gcm_app_handler()->app_handler_count_drop_to_zero());
494 EXPECT_FALSE(HasAppHandlers(extension->id())); 494 EXPECT_FALSE(HasAppHandlers(extension->id()));
495 } 495 }
496 496
497 } // namespace extensions 497 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/convert_user_script.cc ('k') | chrome/browser/extensions/extension_keybinding_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698