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

Unified Diff: chrome/browser/payments/site_per_process_payments_browsertest.cc

Issue 2545693002: Support allowpaymentrequest with out-of-process iframes (Closed)
Patch Set: Added Test Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/payments/site_per_process_payments_browsertest.cc
diff --git a/chrome/browser/payments/site_per_process_payments_browsertest.cc b/chrome/browser/payments/site_per_process_payments_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..55d2de52836d1245ac43c38555af9a4d57648fac
--- /dev/null
+++ b/chrome/browser/payments/site_per_process_payments_browsertest.cc
@@ -0,0 +1,60 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/command_line.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/ui_test_utils.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_widget_host_view.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/test/browser_test_utils.h"
+#include "content/public/test/test_utils.h"
+#include "net/dns/mock_host_resolver.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
+#include "url/gurl.h"
+#include "url/url_constants.h"
+
+namespace payments {
+
+class SitePerProcessPaymentsBrowserTest : public InProcessBrowserTest {
+ public:
+ SitePerProcessPaymentsBrowserTest() {}
+ ~SitePerProcessPaymentsBrowserTest() override {}
+
+ private:
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ InProcessBrowserTest::SetUpCommandLine(command_line);
+ command_line->AppendSwitch("enable-experimental-web-platform-features");
+ // Append --site-per-process flag.
+ content::IsolateAllSitesForTesting(command_line);
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(SitePerProcessPaymentsBrowserTest);
+};
+
+IN_PROC_BROWSER_TEST_F(SitePerProcessPaymentsBrowserTest,
+ IframePaymentRequestDoesNotCrash) {
+ net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
+ https_server.ServeFilesFromSourceDirectory("chrome/test/data");
+ host_resolver()->AddRule("*", "127.0.0.1");
+ content::SetupCrossSiteRedirector(&https_server);
+ ASSERT_TRUE(https_server.InitializeAndListen());
+ ASSERT_TRUE(https_server.Start());
+
+ ui_test_utils::NavigateToURL(
+ browser(),
+ GURL(https_server.GetURL("/payment_request_main.html")));
+ content::WebContents* tab =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ EXPECT_TRUE(tab->GetRenderWidgetHostView()->IsShowing());
+ content::RenderFrameHost* frame = ChildFrameAt(tab->GetMainFrame(), 0);
+ EXPECT_TRUE(frame);
+ EXPECT_NE(frame->GetSiteInstance(), tab->GetMainFrame()->GetSiteInstance());
pals 2016/12/06 09:01:28 This test is failing because iframe is not creatin
please use gerrit instead 2016/12/06 13:24:47 You need to do something like this: // Navigate
alexmos 2016/12/06 17:50:40 Why do you need to use the HTTPS server? If it's
+}
+
+} // namespace payments
« no previous file with comments | « no previous file | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698