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

Side by Side Diff: chrome/browser/payments/site_per_process_payments_browsertest.cc

Issue 2715013002: [Payments] Put Web Payments feature on desktop behind flag (Closed)
Patch Set: untouch runtime_features file Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/browser_tabstrip.h" 7 #include "chrome/browser/ui/browser_tabstrip.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" 8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "chrome/test/base/in_process_browser_test.h" 9 #include "chrome/test/base/in_process_browser_test.h"
10 #include "chrome/test/base/ui_test_utils.h" 10 #include "chrome/test/base/ui_test_utils.h"
11 #include "content/public/browser/render_frame_host.h" 11 #include "content/public/browser/render_frame_host.h"
12 #include "content/public/browser/render_view_host.h" 12 #include "content/public/browser/render_view_host.h"
13 #include "content/public/browser/render_widget_host_view.h" 13 #include "content/public/browser/render_widget_host_view.h"
14 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
15 #include "content/public/common/content_features.h"
15 #include "content/public/common/content_switches.h" 16 #include "content/public/common/content_switches.h"
16 #include "content/public/test/browser_test_utils.h" 17 #include "content/public/test/browser_test_utils.h"
17 #include "content/public/test/test_utils.h" 18 #include "content/public/test/test_utils.h"
18 #include "net/dns/mock_host_resolver.h" 19 #include "net/dns/mock_host_resolver.h"
19 #include "net/test/embedded_test_server/embedded_test_server.h" 20 #include "net/test/embedded_test_server/embedded_test_server.h"
20 #include "url/gurl.h" 21 #include "url/gurl.h"
21 #include "url/url_constants.h" 22 #include "url/url_constants.h"
22 23
23 namespace payments { 24 namespace payments {
24 25
25 class SitePerProcessPaymentsBrowserTest : public InProcessBrowserTest { 26 class SitePerProcessPaymentsBrowserTest : public InProcessBrowserTest {
26 public: 27 public:
27 SitePerProcessPaymentsBrowserTest() {} 28 SitePerProcessPaymentsBrowserTest() {}
28 ~SitePerProcessPaymentsBrowserTest() override {} 29 ~SitePerProcessPaymentsBrowserTest() override {}
29 30
30 void SetUpCommandLine(base::CommandLine* command_line) override { 31 void SetUpCommandLine(base::CommandLine* command_line) override {
31 InProcessBrowserTest::SetUpCommandLine(command_line); 32 InProcessBrowserTest::SetUpCommandLine(command_line);
32 // HTTPS server only serves a valid cert for localhost, so this is needed 33 // HTTPS server only serves a valid cert for localhost, so this is needed
33 // to load pages from other hosts without an error. 34 // to load pages from other hosts without an error.
34 command_line->AppendSwitch(switches::kIgnoreCertificateErrors); 35 command_line->AppendSwitch(switches::kIgnoreCertificateErrors);
35 command_line->AppendSwitch( 36 command_line->AppendSwitch(
36 switches::kEnableExperimentalWebPlatformFeatures); 37 switches::kEnableExperimentalWebPlatformFeatures);
38 command_line->AppendSwitchASCII(switches::kEnableFeatures,
39 features::kWebPayments.name);
37 // Append --site-per-process flag. 40 // Append --site-per-process flag.
38 content::IsolateAllSitesForTesting(command_line); 41 content::IsolateAllSitesForTesting(command_line);
39 } 42 }
40 43
41 void SetUpOnMainThread() override { 44 void SetUpOnMainThread() override {
42 https_server_.reset( 45 https_server_.reset(
43 new net::EmbeddedTestServer(net::EmbeddedTestServer::TYPE_HTTPS)); 46 new net::EmbeddedTestServer(net::EmbeddedTestServer::TYPE_HTTPS));
44 host_resolver()->AddRule("*", "127.0.0.1"); 47 host_resolver()->AddRule("*", "127.0.0.1");
45 ASSERT_TRUE(https_server_->InitializeAndListen()); 48 ASSERT_TRUE(https_server_->InitializeAndListen());
46 content::SetupCrossSiteRedirector(https_server_.get()); 49 content::SetupCrossSiteRedirector(https_server_.get());
(...skipping 18 matching lines...) Expand all
65 https_server_->GetURL("b.com", "/payment_request_iframe.html"); 68 https_server_->GetURL("b.com", "/payment_request_iframe.html");
66 EXPECT_TRUE(content::NavigateIframeToURL(tab, "test", iframe_url)); 69 EXPECT_TRUE(content::NavigateIframeToURL(tab, "test", iframe_url));
67 70
68 EXPECT_TRUE(tab->GetRenderWidgetHostView()->IsShowing()); 71 EXPECT_TRUE(tab->GetRenderWidgetHostView()->IsShowing());
69 content::RenderFrameHost* frame = ChildFrameAt(tab->GetMainFrame(), 0); 72 content::RenderFrameHost* frame = ChildFrameAt(tab->GetMainFrame(), 0);
70 EXPECT_TRUE(frame); 73 EXPECT_TRUE(frame);
71 EXPECT_NE(frame->GetSiteInstance(), tab->GetMainFrame()->GetSiteInstance()); 74 EXPECT_NE(frame->GetSiteInstance(), tab->GetMainFrame()->GetSiteInstance());
72 } 75 }
73 76
74 } // namespace payments 77 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698