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

Unified Diff: third_party/mojo/src/mojo/public/cpp/bindings/tests/request_response_unittest.cc

Issue 954643002: Update mojo sdk to rev 3d23dae011859a2aae49f1d1adde705c8e85d819 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use run_renderer_in_process() Created 5 years, 10 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
Index: third_party/mojo/src/mojo/public/cpp/bindings/tests/request_response_unittest.cc
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/tests/request_response_unittest.cc b/third_party/mojo/src/mojo/public/cpp/bindings/tests/request_response_unittest.cc
index 4864e35bc4b92f771f4e366cd4f84f5e919354e5..a1fe8e645b7948761e12e6a7d5cb41715903bd01 100644
--- a/third_party/mojo/src/mojo/public/cpp/bindings/tests/request_response_unittest.cc
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/tests/request_response_unittest.cc
@@ -13,8 +13,11 @@ namespace mojo {
namespace test {
namespace {
-class ProviderImpl : public InterfaceImpl<sample::Provider> {
+class ProviderImpl : public sample::Provider {
public:
+ explicit ProviderImpl(InterfaceRequest<sample::Provider> request)
+ : binding_(this, request.Pass()) {}
+
void EchoString(const String& a,
const Callback<void(String)>& callback) override {
Callback<void(String)> callback_copy;
@@ -39,6 +42,8 @@ class ProviderImpl : public InterfaceImpl<sample::Provider> {
const Callback<void(sample::Enum)>& callback) override {
callback.Run(a);
}
+
+ Binding<sample::Provider> binding_;
};
class StringRecorder {
@@ -86,7 +91,7 @@ class RequestResponseTest : public testing::Test {
TEST_F(RequestResponseTest, EchoString) {
sample::ProviderPtr provider;
- BindToProxy(new ProviderImpl(), &provider);
+ ProviderImpl provider_impl(GetProxy(&provider));
std::string buf;
provider->EchoString(String::From("hello"), StringRecorder(&buf));
@@ -98,7 +103,7 @@ TEST_F(RequestResponseTest, EchoString) {
TEST_F(RequestResponseTest, EchoStrings) {
sample::ProviderPtr provider;
- BindToProxy(new ProviderImpl(), &provider);
+ ProviderImpl provider_impl(GetProxy(&provider));
std::string buf;
provider->EchoStrings(
@@ -111,7 +116,7 @@ TEST_F(RequestResponseTest, EchoStrings) {
TEST_F(RequestResponseTest, EchoMessagePipeHandle) {
sample::ProviderPtr provider;
- BindToProxy(new ProviderImpl(), &provider);
+ ProviderImpl provider_impl(GetProxy(&provider));
MessagePipe pipe2;
provider->EchoMessagePipeHandle(pipe2.handle1.Pass(),
@@ -127,7 +132,7 @@ TEST_F(RequestResponseTest, EchoMessagePipeHandle) {
TEST_F(RequestResponseTest, EchoEnum) {
sample::ProviderPtr provider;
- BindToProxy(new ProviderImpl(), &provider);
+ ProviderImpl provider_impl(GetProxy(&provider));
sample::Enum value;
provider->EchoEnum(sample::ENUM_VALUE, EnumRecorder(&value));

Powered by Google App Engine
This is Rietveld 408576698