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

Unified Diff: components/test_runner/test_runner_for_specific_view.cc

Issue 2647243002: PaymentApp: Implement PaymentAppProvider for LayoutTest.
Patch Set: PaymentApp: Implement PaymentAppProvider for LayoutTest. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/test_runner/test_runner_for_specific_view.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/test_runner_for_specific_view.cc
diff --git a/components/test_runner/test_runner_for_specific_view.cc b/components/test_runner/test_runner_for_specific_view.cc
index 026a715908e58ab286b7085a9c0b31f2d40e0864..f29cb45a95efb2031fd93adf77df3ebfa1200812 100644
--- a/components/test_runner/test_runner_for_specific_view.cc
+++ b/components/test_runner/test_runner_for_specific_view.cc
@@ -366,6 +366,40 @@ void TestRunnerForSpecificView::SendBluetoothManualChooserEvent(
delegate()->SendBluetoothManualChooserEvent(event, argument);
}
+void TestRunnerForSpecificView::GetAllPaymentAppIDs(
+ v8::Local<v8::Function> callback) {
+ delegate()->GetAllPaymentAppIDs(
+ base::Bind(&TestRunnerForSpecificView::GetAllPaymentAppIDsCallback,
+ weak_factory_.GetWeakPtr(),
+ base::Passed(v8::UniquePersistent<v8::Function>(
+ blink::mainThreadIsolate(), callback))));
+}
+
+void TestRunnerForSpecificView::GetAllPaymentAppIDsCallback(
+ v8::UniquePersistent<v8::Function> callback,
+ const std::vector<int64_t>& ids) {
+ // Build the V8 context.
+ v8::Isolate* isolate = blink::mainThreadIsolate();
+ v8::HandleScope handle_scope(isolate);
+ v8::Local<v8::Context> context =
+ web_view()->mainFrame()->mainWorldScriptContext();
+ if (context.IsEmpty())
+ return;
+ v8::Context::Scope context_scope(context);
+
+ // Convert the argument.
+ v8::Local<v8::Value> arg;
+ if (!gin::TryConvertToV8(isolate, ids, &arg))
+ return;
+
+ // Call the callback.
+ PostV8CallbackWithArgs(std::move(callback), 1, &arg);
+}
+
+void TestRunnerForSpecificView::InvokePaymentApp(int64_t registration_id) {
+ delegate()->InvokePaymentApp(registration_id);
+}
+
void TestRunnerForSpecificView::SetBackingScaleFactor(
double value,
v8::Local<v8::Function> callback) {
« no previous file with comments | « components/test_runner/test_runner_for_specific_view.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698