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

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

Issue 4727001: Split the private webstore install API into two parts.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/stringprintf.h" 5 #include "base/stringprintf.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/extensions/extension_webstore_private_api.h" 7 #include "chrome/browser/extensions/extension_webstore_private_api.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 #include "chrome/test/ui_test_utils.h" 9 #include "chrome/test/ui_test_utils.h"
10 #include "net/base/mock_host_resolver.h" 10 #include "net/base/mock_host_resolver.h"
(...skipping 15 matching lines...) Expand all
26 #endif 26 #endif
27 IN_PROC_BROWSER_TEST_F(ExtensionGalleryInstallApiTest, 27 IN_PROC_BROWSER_TEST_F(ExtensionGalleryInstallApiTest,
28 MAYBE_InstallAndUninstall) { 28 MAYBE_InstallAndUninstall) {
29 host_resolver()->AddRule("www.example.com", "127.0.0.1"); 29 host_resolver()->AddRule("www.example.com", "127.0.0.1");
30 ASSERT_TRUE(test_server()->Start()); 30 ASSERT_TRUE(test_server()->Start());
31 31
32 std::string base_url = base::StringPrintf( 32 std::string base_url = base::StringPrintf(
33 "http://www.example.com:%u/files/extensions/", 33 "http://www.example.com:%u/files/extensions/",
34 test_server()->host_port_pair().port()); 34 test_server()->host_port_pair().port());
35 35
36 BeginInstallFunction::SetIgnoreUserGestureForTests(true);
36 std::string testing_install_base_url = base_url; 37 std::string testing_install_base_url = base_url;
37 testing_install_base_url += "good.crx"; 38 testing_install_base_url += "good.crx";
38 InstallFunction::SetTestingInstallBaseUrl(testing_install_base_url.c_str()); 39 CompleteInstallFunction::SetTestingInstallBaseUrl(
40 testing_install_base_url.c_str());
39 41
40 std::string page_url = base_url; 42 std::string page_url = base_url;
41 page_url += "api_test/extension_gallery_install/test.html"; 43 page_url += "api_test/extension_gallery_install/test.html";
42 ASSERT_TRUE(RunPageTest(page_url.c_str())); 44 ASSERT_TRUE(RunPageTest(page_url.c_str()));
45
46 page_url = base_url;
47 page_url += "api_test/extension_gallery_install/test.html?expect_error=true";
48 BeginInstallFunction::SetIgnoreUserGestureForTests(false);
49 ASSERT_TRUE(RunPageTest(page_url.c_str()));
43 } 50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698