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

Side by Side Diff: content/browser/payments/payment_app_browsertest.cc

Issue 2958333002: [Payments] Implement web payment app manifest (Closed)
Patch Set: rename and comments Created 3 years, 5 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 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/browser/storage_partition_impl.h" 8 #include "content/browser/storage_partition_impl.h"
9 #include "content/public/browser/browser_context.h" 9 #include "content/public/browser/browser_context.h"
10 #include "content/public/browser/payment_app_provider.h" 10 #include "content/public/browser/payment_app_provider.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 base::RunLoop run_loop; 88 base::RunLoop run_loop;
89 PaymentAppProvider::PaymentApps apps; 89 PaymentAppProvider::PaymentApps apps;
90 PaymentAppProvider::GetInstance()->GetAllPaymentApps( 90 PaymentAppProvider::GetInstance()->GetAllPaymentApps(
91 shell()->web_contents()->GetBrowserContext(), 91 shell()->web_contents()->GetBrowserContext(),
92 base::BindOnce(&GetAllPaymentAppsCallback, run_loop.QuitClosure(), 92 base::BindOnce(&GetAllPaymentAppsCallback, run_loop.QuitClosure(),
93 &apps)); 93 &apps));
94 run_loop.Run(); 94 run_loop.Run();
95 95
96 std::map<std::string, int64_t> registrationIds; 96 std::map<std::string, int64_t> registrationIds;
97 for (const auto& app_info : apps) { 97 for (const auto& app_info : apps) {
98 for (const auto& instrument : app_info.second) { 98 for (const auto& instrument : app_info.second->instruments) {
99 registrationIds.insert(std::pair<std::string, int64_t>( 99 registrationIds.insert(std::pair<std::string, int64_t>(
100 instrument->instrument_key, instrument->registration_id)); 100 instrument->instrument_key, app_info.second->registration_id));
101 } 101 }
102 } 102 }
103 103
104 return registrationIds; 104 return registrationIds;
105 } 105 }
106 106
107 PaymentAppResponsePtr InvokePaymentAppWithTestData( 107 PaymentAppResponsePtr InvokePaymentAppWithTestData(
108 int64_t registration_id, 108 int64_t registration_id,
109 const std::string& supported_method, 109 const std::string& supported_method,
110 const std::string& instrument_key) { 110 const std::string& instrument_key) {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 PopConsoleString() /* total */); 234 PopConsoleString() /* total */);
235 EXPECT_EQ( 235 EXPECT_EQ(
236 "[{\"additionalDisplayItems\":[],\"supportedMethods\":[\"https://" 236 "[{\"additionalDisplayItems\":[],\"supportedMethods\":[\"https://"
237 "bobpay.com\"]," 237 "bobpay.com\"],"
238 "\"total\":{\"amount\":{\"currency\":\"USD\",\"currencySystem\":\"urn:" 238 "\"total\":{\"amount\":{\"currency\":\"USD\",\"currencySystem\":\"urn:"
239 "iso:std:iso:4217\",\"value\":\"\"},\"label\":\"\",\"pending\":false}}]", 239 "iso:std:iso:4217\",\"value\":\"\"},\"label\":\"\",\"pending\":false}}]",
240 PopConsoleString() /* modifiers */); 240 PopConsoleString() /* modifiers */);
241 EXPECT_EQ("bobpay-payment-app-id", PopConsoleString() /* instrumentKey */); 241 EXPECT_EQ("bobpay-payment-app-id", PopConsoleString() /* instrumentKey */);
242 } 242 }
243 } // namespace content 243 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/payments/payment_app.proto ('k') | content/browser/payments/payment_app_content_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698