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

Side by Side Diff: content/browser/intents/internal_web_intents_dispatcher_unittest.cc

Issue 10218009: Allow severing connection between dispatcher and injector (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "content/browser/intents/intent_injector.h" 7 #include "content/browser/intents/intent_injector.h"
8 #include "content/browser/intents/internal_web_intents_dispatcher.h" 8 #include "content/browser/intents/internal_web_intents_dispatcher.h"
9 #include "content/browser/renderer_host/test_render_view_host.h" 9 #include "content/browser/renderer_host/test_render_view_host.h"
10 #include "content/browser/web_contents/test_web_contents.h" 10 #include "content/browser/web_contents/test_web_contents.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 dispatcher->DispatchIntent(web_contents()); 51 dispatcher->DispatchIntent(web_contents());
52 52
53 dispatcher->SendReplyMessage(webkit_glue::WEB_INTENT_REPLY_SUCCESS, 53 dispatcher->SendReplyMessage(webkit_glue::WEB_INTENT_REPLY_SUCCESS,
54 ASCIIToUTF16("success")); 54 ASCIIToUTF16("success"));
55 55
56 EXPECT_EQ(ASCIIToUTF16("success"), notified_data_); 56 EXPECT_EQ(ASCIIToUTF16("success"), notified_data_);
57 EXPECT_EQ(1, replied_); 57 EXPECT_EQ(1, replied_);
58 EXPECT_EQ(webkit_glue::WEB_INTENT_REPLY_SUCCESS, notified_reply_type_); 58 EXPECT_EQ(webkit_glue::WEB_INTENT_REPLY_SUCCESS, notified_reply_type_);
59 } 59 }
60
61 TEST_F(InternalWebIntentsDispatcherTest, CancelAbandonsInjector) {
62 webkit_glue::WebIntentData intent(ASCIIToUTF16("action"),
63 ASCIIToUTF16("type"),
64 ASCIIToUTF16("unserialized_data"));
65 InternalWebIntentsDispatcher* dispatcher = new InternalWebIntentsDispatcher(
66 intent, base::Bind(&InternalWebIntentsDispatcherTest::NotifyReply,
67 base::Unretained(this)));
68 dispatcher->DispatchIntent(web_contents());
69 EXPECT_FALSE(dispatcher->intent_injector_ == NULL);
70 dispatcher->CancelDispatch();
71 EXPECT_TRUE(dispatcher->intent_injector_ == NULL);
72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698