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

Side by Side Diff: ios/web/webui/mojo_facade_unittest.mm

Issue 2215133002: Change signature of OnConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: . Created 4 years, 4 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
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | mash/app_driver/app_driver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import "ios/web/webui/mojo_facade.h" 5 #import "ios/web/webui/mojo_facade.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #import "base/mac/scoped_nsobject.h" 10 #import "base/mac/scoped_nsobject.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void Create(const shell::Identity& remote_identity, 54 void Create(const shell::Identity& remote_identity,
55 mojo::InterfaceRequest<TestUIHandlerMojo> request) override {} 55 mojo::InterfaceRequest<TestUIHandlerMojo> request) override {}
56 }; 56 };
57 57
58 } // namespace 58 } // namespace
59 59
60 // A test fixture to test MojoFacade class. 60 // A test fixture to test MojoFacade class.
61 class MojoFacadeTest : public WebTest { 61 class MojoFacadeTest : public WebTest {
62 protected: 62 protected:
63 MojoFacadeTest() { 63 MojoFacadeTest() {
64 interface_registry_.reset(new shell::InterfaceRegistry(nullptr)); 64 interface_registry_.reset(new shell::InterfaceRegistry);
65 interface_registry_->AddInterface(&ui_handler_factory_); 65 interface_registry_->AddInterface(&ui_handler_factory_);
66 evaluator_.reset([[OCMockObject 66 evaluator_.reset([[OCMockObject
67 mockForProtocol:@protocol(CRWJSInjectionEvaluator)] retain]); 67 mockForProtocol:@protocol(CRWJSInjectionEvaluator)] retain]);
68 facade_.reset(new MojoFacade( 68 facade_.reset(new MojoFacade(
69 interface_registry_.get(), 69 interface_registry_.get(),
70 static_cast<id<CRWJSInjectionEvaluator>>(evaluator_.get()))); 70 static_cast<id<CRWJSInjectionEvaluator>>(evaluator_.get())));
71 } 71 }
72 72
73 OCMockObject* evaluator() { return evaluator_.get(); } 73 OCMockObject* evaluator() { return evaluator_.get(); }
74 MojoFacade* facade() { return facade_.get(); } 74 MojoFacade* facade() { return facade_.get(); }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 NSDictionary* message = GetObject(facade()->HandleMojoMessage(GetJson(read))); 268 NSDictionary* message = GetObject(facade()->HandleMojoMessage(GetJson(read)));
269 EXPECT_TRUE([message isKindOfClass:[NSDictionary class]]); 269 EXPECT_TRUE([message isKindOfClass:[NSDictionary class]]);
270 EXPECT_TRUE(message); 270 EXPECT_TRUE(message);
271 NSArray* expected_message = @[ @9, @2, @216 ]; // 2008 does not fit 8-bit. 271 NSArray* expected_message = @[ @9, @2, @216 ]; // 2008 does not fit 8-bit.
272 EXPECT_NSEQ(expected_message, message[@"buffer"]); 272 EXPECT_NSEQ(expected_message, message[@"buffer"]);
273 EXPECT_FALSE([message[@"handles"] count]); 273 EXPECT_FALSE([message[@"handles"] count]);
274 EXPECT_EQ(MOJO_RESULT_OK, [message[@"result"] unsignedIntValue]); 274 EXPECT_EQ(MOJO_RESULT_OK, [message[@"result"] unsignedIntValue]);
275 } 275 }
276 276
277 } // namespace web 277 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | mash/app_driver/app_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698