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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentResponseTest.cpp

Issue 1902263004: Mojo: Change the blink variant from "wtf" to "blink". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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 "modules/payments/PaymentResponse.h" 5 #include "modules/payments/PaymentResponse.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/testing/DummyPageHolder.h" 9 #include "core/testing/DummyPageHolder.h"
10 #include "modules/payments/PaymentCompleter.h" 10 #include "modules/payments/PaymentCompleter.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->doc ument().frame()); } 51 ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->doc ument().frame()); }
52 ExceptionState& getExceptionState() { return m_exceptionState; } 52 ExceptionState& getExceptionState() { return m_exceptionState; }
53 53
54 private: 54 private:
55 OwnPtr<DummyPageHolder> m_page; 55 OwnPtr<DummyPageHolder> m_page;
56 NonThrowableExceptionState m_exceptionState; 56 NonThrowableExceptionState m_exceptionState;
57 }; 57 };
58 58
59 TEST_F(PaymentResponseTest, DataCopiedOver) 59 TEST_F(PaymentResponseTest, DataCopiedOver)
60 { 60 {
61 mojom::wtf::PaymentResponsePtr input = mojom::wtf::PaymentResponse::New(); 61 mojom::blink::PaymentResponsePtr input = mojom::blink::PaymentResponse::New( );
62 input->method_name = "foo"; 62 input->method_name = "foo";
63 input->stringified_details = "{\"transactionId\": 123}"; 63 input->stringified_details = "{\"transactionId\": 123}";
64 MockPaymentCompleter* completeCallback = new MockPaymentCompleter; 64 MockPaymentCompleter* completeCallback = new MockPaymentCompleter;
65 65
66 PaymentResponse output(std::move(input), completeCallback); 66 PaymentResponse output(std::move(input), completeCallback);
67 67
68 // TODO(rouslan): Verify that output.details() contains parsed input->string ified_details. 68 // TODO(rouslan): Verify that output.details() contains parsed input->string ified_details.
69 EXPECT_FALSE(getExceptionState().hadException()); 69 EXPECT_FALSE(getExceptionState().hadException());
70 EXPECT_EQ("foo", output.methodName()); 70 EXPECT_EQ("foo", output.methodName());
71 } 71 }
72 72
73 TEST_F(PaymentResponseTest, CompleteCalled) 73 TEST_F(PaymentResponseTest, CompleteCalled)
74 { 74 {
75 mojom::wtf::PaymentResponsePtr input = mojom::wtf::PaymentResponse::New(); 75 mojom::blink::PaymentResponsePtr input = mojom::blink::PaymentResponse::New( );
76 input->method_name = "foo"; 76 input->method_name = "foo";
77 input->stringified_details = "{\"transactionId\": 123}"; 77 input->stringified_details = "{\"transactionId\": 123}";
78 MockPaymentCompleter* completeCallback = new MockPaymentCompleter; 78 MockPaymentCompleter* completeCallback = new MockPaymentCompleter;
79 PaymentResponse output(std::move(input), completeCallback); 79 PaymentResponse output(std::move(input), completeCallback);
80 80
81 EXPECT_FALSE(getExceptionState().hadException()); 81 EXPECT_FALSE(getExceptionState().hadException());
82 EXPECT_CALL(*completeCallback, complete(getScriptState(), true)); 82 EXPECT_CALL(*completeCallback, complete(getScriptState(), true));
83 83
84 output.complete(getScriptState(), true); 84 output.complete(getScriptState(), true);
85 } 85 }
86 86
87 } // namespace 87 } // namespace
88 } // namespace blink 88 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698