OLD | NEW |
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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/browser/extensions/extension_install_ui.h" | 9 #include "chrome/browser/extensions/extension_install_ui.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 scoped_refptr<const Extension> hosted_app = ExtensionBuilder() | 212 scoped_refptr<const Extension> hosted_app = ExtensionBuilder() |
213 .SetManifest(DictionaryBuilder() | 213 .SetManifest(DictionaryBuilder() |
214 .Set("name", "hosted app") | 214 .Set("name", "hosted app") |
215 .Set("version", "1") | 215 .Set("version", "1") |
216 .Set("app", DictionaryBuilder() | 216 .Set("app", DictionaryBuilder() |
217 .Set("urls", ListBuilder().Append(kInstallUrl.spec())) | 217 .Set("urls", ListBuilder().Append(kInstallUrl.spec())) |
218 .Set("launch", DictionaryBuilder() | 218 .Set("launch", DictionaryBuilder() |
219 .Set("web_url", kInstallUrl.spec()))) | 219 .Set("web_url", kInstallUrl.spec()))) |
220 .Set("manifest_version", 2)) | 220 .Set("manifest_version", 2)) |
221 .Build(); | 221 .Build(); |
222 ASSERT_TRUE(hosted_app); | 222 ASSERT_TRUE(hosted_app.get()); |
223 | 223 |
224 ExtensionService* extension_service = | 224 ExtensionService* extension_service = |
225 extensions::ExtensionSystem::Get(browser()->profile())-> | 225 extensions::ExtensionSystem::Get(browser()->profile())-> |
226 extension_service(); | 226 extension_service(); |
227 | 227 |
228 extension_service->AddExtension(hosted_app.get()); | 228 extension_service->AddExtension(hosted_app.get()); |
229 EXPECT_TRUE(extension_service->extensions()->Contains(hosted_app->id())); | 229 EXPECT_TRUE(extension_service->extensions()->Contains(hosted_app->id())); |
230 | 230 |
231 ui_test_utils::NavigateToURL(browser(), kInstallUrl); | 231 ui_test_utils::NavigateToURL(browser(), kInstallUrl); |
232 | 232 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 356 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
357 command_line->AppendSwitchASCII( | 357 command_line->AppendSwitchASCII( |
358 switches::kLimitedInstallFromWebstore, "2"); | 358 switches::kLimitedInstallFromWebstore, "2"); |
359 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), | 359 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), |
360 base::MessageLoop::QuitWhenIdleClosure()); | 360 base::MessageLoop::QuitWhenIdleClosure()); |
361 base::MessageLoop::current()->Run(); | 361 base::MessageLoop::current()->Run(); |
362 | 362 |
363 EXPECT_TRUE(saw_install()); | 363 EXPECT_TRUE(saw_install()); |
364 EXPECT_EQ(0, browser_open_count()); | 364 EXPECT_EQ(0, browser_open_count()); |
365 } | 365 } |
OLD | NEW |