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

Unified Diff: ios/web/webui/mojo_facade_unittest.mm

Issue 2725133002: Mojo: Armed Watchers (Closed)
Patch Set: rebase Created 3 years, 9 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: ios/web/webui/mojo_facade_unittest.mm
diff --git a/ios/web/webui/mojo_facade_unittest.mm b/ios/web/webui/mojo_facade_unittest.mm
index 542124c4a20567327c6e0454f454513381994130..cf7e5125bff2e7623299bd2eba2ac4a90990a2d9 100644
--- a/ios/web/webui/mojo_facade_unittest.mm
+++ b/ios/web/webui/mojo_facade_unittest.mm
@@ -199,6 +199,18 @@ TEST_F(MojoFacadeTest, Watch) {
callback_id, MOJO_RESULT_OK];
[[[evaluator() expect] andDo:^(NSInvocation*) {
callback_received = true;
+
+ // Cancel the watch immediately to ensure there are no additional
+ // notifications.
+ NSDictionary* cancel_watch = @{
+ @"name" : @"support.cancelWatch",
+ @"args" : @{
+ @"watchId" : @(watch_id),
+ },
+ };
+ std::string result_as_string =
+ facade()->HandleMojoMessage(GetJson(cancel_watch));
+ EXPECT_TRUE(result_as_string.empty());
}] executeJavaScript:expected_script completionHandler:nil];
// Write to the other end of the pipe.

Powered by Google App Engine
This is Rietveld 408576698