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

Side by Side Diff: chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc

Issue 10356052: Disable off-store extension installs by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: argh Created 8 years, 7 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 | Annotate | Revision Log
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 <algorithm> 5 #include <algorithm>
6 #include <iterator> 6 #include <iterator>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 205 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
206 // We start the test server now instead of in 206 // We start the test server now instead of in
207 // SetUpInProcessBrowserTestFixture so that we can get its port number. 207 // SetUpInProcessBrowserTestFixture so that we can get its port number.
208 ASSERT_TRUE(test_server()->Start()); 208 ASSERT_TRUE(test_server()->Start());
209 209
210 InProcessBrowserTest::SetUpCommandLine(command_line); 210 InProcessBrowserTest::SetUpCommandLine(command_line);
211 211
212 net::HostPortPair host_port = test_server()->host_port_pair(); 212 net::HostPortPair host_port = test_server()->host_port_pair();
213 command_line->AppendSwitchASCII( 213 command_line->AppendSwitchASCII(
214 switches::kAppsGalleryURL,
215 base::StringPrintf("http://www.example.com:%d", host_port.port()));
216 command_line->AppendSwitchASCII(
214 switches::kAppsGalleryDownloadURL, 217 switches::kAppsGalleryDownloadURL,
215 base::StringPrintf( 218 base::StringPrintf(
216 "http://www.example.com:%d/files/extensions/intents/%%s.crx", 219 "http://www.example.com:%d/files/extensions/intents/%%s.crx",
217 host_port.port())); 220 host_port.port()));
218 command_line->AppendSwitchASCII( 221 command_line->AppendSwitchASCII(
219 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); 222 switches::kAppsGalleryInstallAutoConfirmForTests, "accept");
220 } 223 }
221 224
222 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 225 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
223 host_resolver()->AddRule("www.example.com", "127.0.0.1"); 226 host_resolver()->AddRule("www.example.com", "127.0.0.1");
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 596
594 EXPECT_EQ(2, picker_.num_installed_services_); 597 EXPECT_EQ(2, picker_.num_installed_services_);
595 598
596 // The tab is shown immediately without needing to call OnServiceChosen. 599 // The tab is shown immediately without needing to call OnServiceChosen.
597 ASSERT_EQ(2, browser()->tab_count()); 600 ASSERT_EQ(2, browser()->tab_count());
598 EXPECT_EQ(GURL(kServiceURL1), 601 EXPECT_EQ(GURL(kServiceURL1),
599 browser()->GetSelectedWebContents()->GetURL()); 602 browser()->GetSelectedWebContents()->GetURL());
600 603
601 EXPECT_TRUE(dispatcher.dispatched_); 604 EXPECT_TRUE(dispatcher.dispatched_);
602 } 605 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698