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

Side by Side Diff: chrome/browser/extensions/webstore_startup_installer_browsertest.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, 10 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 <utility> 5 #include <utility>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/scoped_observer.h" 8 #include "base/scoped_observer.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // Regression test for http://crbug.com/144991. 134 // Regression test for http://crbug.com/144991.
135 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, InstallFromHostedApp) { 135 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, InstallFromHostedApp) {
136 AutoAcceptInstall(); 136 AutoAcceptInstall();
137 137
138 const GURL kInstallUrl = GenerateTestServerUrl(kAppDomain, "install.html"); 138 const GURL kInstallUrl = GenerateTestServerUrl(kAppDomain, "install.html");
139 139
140 // We're forced to construct a hosted app dynamically because we need the 140 // We're forced to construct a hosted app dynamically because we need the
141 // app to run on a declared URL, but we don't know the port ahead of time. 141 // app to run on a declared URL, but we don't know the port ahead of time.
142 scoped_refptr<const Extension> hosted_app = 142 scoped_refptr<const Extension> hosted_app =
143 ExtensionBuilder() 143 ExtensionBuilder()
144 .SetManifest(std::move( 144 .SetManifest(
145 DictionaryBuilder() 145 DictionaryBuilder()
146 .Set("name", "hosted app") 146 .Set("name", "hosted app")
147 .Set("version", "1") 147 .Set("version", "1")
148 .Set("app", 148 .Set(
149 std::move( 149 "app",
150 DictionaryBuilder() 150 DictionaryBuilder()
151 .Set("urls", std::move(ListBuilder().Append( 151 .Set("urls",
152 kInstallUrl.spec()))) 152 ListBuilder().Append(kInstallUrl.spec()).Build())
153 .Set("launch", 153 .Set("launch", DictionaryBuilder()
154 std::move(DictionaryBuilder().Set( 154 .Set("web_url", kInstallUrl.spec())
155 "web_url", kInstallUrl.spec()))))) 155 .Build())
156 .Set("manifest_version", 2))) 156 .Build())
157 .Set("manifest_version", 2)
158 .Build())
157 .Build(); 159 .Build();
158 ASSERT_TRUE(hosted_app.get()); 160 ASSERT_TRUE(hosted_app.get());
159 161
160 ExtensionService* extension_service = 162 ExtensionService* extension_service =
161 extensions::ExtensionSystem::Get(browser()->profile())-> 163 extensions::ExtensionSystem::Get(browser()->profile())->
162 extension_service(); 164 extension_service();
163 extensions::ExtensionRegistry* registry = 165 extensions::ExtensionRegistry* registry =
164 extensions::ExtensionRegistry::Get(browser()->profile()); 166 extensions::ExtensionRegistry::Get(browser()->profile());
165 167
166 extension_service->AddExtension(hosted_app.get()); 168 extension_service->AddExtension(hosted_app.get());
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 229
228 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallUnpackFailureTest, 230 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallUnpackFailureTest,
229 WebstoreStartupInstallUnpackFailureTest) { 231 WebstoreStartupInstallUnpackFailureTest) {
230 AutoAcceptInstall(); 232 AutoAcceptInstall();
231 233
232 ui_test_utils::NavigateToURL(browser(), 234 ui_test_utils::NavigateToURL(browser(),
233 GenerateTestServerUrl(kAppDomain, "install_unpack_failure.html")); 235 GenerateTestServerUrl(kAppDomain, "install_unpack_failure.html"));
234 236
235 RunTest("runTest"); 237 RunTest("runTest");
236 } 238 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698