| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 void SetUpCommandLine(base::CommandLine* command_line) override { | 27 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 28 InProcessBrowserTest::SetUpCommandLine(command_line); | 28 InProcessBrowserTest::SetUpCommandLine(command_line); |
| 29 command_line->AppendSwitch( | 29 command_line->AppendSwitch( |
| 30 switches::kEnableExperimentalWebPlatformFeatures); | 30 switches::kEnableExperimentalWebPlatformFeatures); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void SetUpOnMainThread() override { | 33 void SetUpOnMainThread() override { |
| 34 https_server_.reset( | 34 https_server_.reset( |
| 35 new net::EmbeddedTestServer(net::EmbeddedTestServer::TYPE_HTTPS)); | 35 new net::EmbeddedTestServer(net::EmbeddedTestServer::TYPE_HTTPS)); |
| 36 ASSERT_TRUE(https_server_->InitializeAndListen()); | 36 ASSERT_TRUE(https_server_->InitializeAndListen()); |
| 37 https_server_->ServeFilesFromSourceDirectory("chrome/test/data"); | 37 https_server_->ServeFilesFromSourceDirectory("chrome/test/data/payments"); |
| 38 https_server_->StartAcceptingConnections(); | 38 https_server_->StartAcceptingConnections(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 // Convenience method to get a list of PaymentRequest associated with | 41 // Convenience method to get a list of PaymentRequest associated with |
| 42 // |web_contents|. | 42 // |web_contents|. |
| 43 const std::vector<PaymentRequest*> GetPaymentRequests( | 43 const std::vector<PaymentRequest*> GetPaymentRequests( |
| 44 content::WebContents* web_contents) { | 44 content::WebContents* web_contents) { |
| 45 PaymentRequestWebContentsManager* manager = | 45 PaymentRequestWebContentsManager* manager = |
| 46 PaymentRequestWebContentsManager::GetOrCreateForWebContents( | 46 PaymentRequestWebContentsManager::GetOrCreateForWebContents( |
| 47 web_contents); | 47 web_contents); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 65 MultiplePaymentRequests) { | 65 MultiplePaymentRequests) { |
| 66 GURL url = https_server_->GetURL("/payment_request_multiple_requests.html"); | 66 GURL url = https_server_->GetURL("/payment_request_multiple_requests.html"); |
| 67 ui_test_utils::NavigateToURL(browser(), url); | 67 ui_test_utils::NavigateToURL(browser(), url); |
| 68 | 68 |
| 69 const std::vector<PaymentRequest*> payment_requests = | 69 const std::vector<PaymentRequest*> payment_requests = |
| 70 GetPaymentRequests(browser()->tab_strip_model()->GetActiveWebContents()); | 70 GetPaymentRequests(browser()->tab_strip_model()->GetActiveWebContents()); |
| 71 EXPECT_EQ(5U, payment_requests.size()); | 71 EXPECT_EQ(5U, payment_requests.size()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace payments | 74 } // namespace payments |
| OLD | NEW |