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

Side by Side Diff: chrome/browser/extensions/test_extension_environment.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 (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/test_extension_environment.h" 5 #include "chrome/browser/extensions/test_extension_environment.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 ADD_FAILURE() << "Expected dictionary; got \"" << manifest_json << "\""; 53 ADD_FAILURE() << "Expected dictionary; got \"" << manifest_json << "\"";
54 } 54 }
55 return manifest; 55 return manifest;
56 } 56 }
57 57
58 scoped_ptr<base::DictionaryValue> MakePackagedAppManifest() { 58 scoped_ptr<base::DictionaryValue> MakePackagedAppManifest() {
59 return extensions::DictionaryBuilder() 59 return extensions::DictionaryBuilder()
60 .Set("name", "Test App Name") 60 .Set("name", "Test App Name")
61 .Set("version", "2.0") 61 .Set("version", "2.0")
62 .Set("manifest_version", 2) 62 .Set("manifest_version", 2)
63 .Set("app", std::move(extensions::DictionaryBuilder().Set( 63 .Set("app", extensions::DictionaryBuilder()
64 "background", 64 .Set("background",
65 std::move(extensions::DictionaryBuilder().Set( 65 extensions::DictionaryBuilder()
66 "scripts", std::move(extensions::ListBuilder().Append( 66 .Set("scripts", extensions::ListBuilder()
67 "background.js"))))))) 67 .Append("background.js")
68 .Build())
69 .Build())
70 .Build())
68 .Build(); 71 .Build();
69 } 72 }
70 73
71 } // namespace 74 } // namespace
72 75
73 // Extra environment state required for ChromeOS. 76 // Extra environment state required for ChromeOS.
74 class TestExtensionEnvironment::ChromeOSEnv { 77 class TestExtensionEnvironment::ChromeOSEnv {
75 public: 78 public:
76 ChromeOSEnv() {} 79 ChromeOSEnv() {}
77 80
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 SessionTabHelper::CreateForWebContents(contents.get()); 179 SessionTabHelper::CreateForWebContents(contents.get());
177 return contents; 180 return contents;
178 } 181 }
179 182
180 void TestExtensionEnvironment::DeleteProfile() { 183 void TestExtensionEnvironment::DeleteProfile() {
181 profile_.reset(); 184 profile_.reset();
182 extension_service_ = nullptr; 185 extension_service_ = nullptr;
183 } 186 }
184 187
185 } // namespace extensions 188 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698