OLD | NEW |
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 <algorithm> | 5 #include <algorithm> |
6 #include <iterator> | 6 #include <iterator> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 explicit TestIntentsDispatcher(const webkit_glue::WebIntentData& intent) | 50 explicit TestIntentsDispatcher(const webkit_glue::WebIntentData& intent) |
51 : intent_(intent) {} | 51 : intent_(intent) {} |
52 | 52 |
53 virtual const webkit_glue::WebIntentData& GetIntent() OVERRIDE { | 53 virtual const webkit_glue::WebIntentData& GetIntent() OVERRIDE { |
54 return intent_; | 54 return intent_; |
55 } | 55 } |
56 | 56 |
57 virtual void DispatchIntent(content::WebContents* web_contents) OVERRIDE {} | 57 virtual void DispatchIntent(content::WebContents* web_contents) OVERRIDE {} |
58 virtual void ResetDispatch() OVERRIDE {} | 58 virtual void ResetDispatch() OVERRIDE {} |
59 | 59 |
60 virtual void SendReplyMessage( | |
61 webkit_glue::WebIntentReplyType reply_type, | |
62 const string16& data) OVERRIDE { | |
63 SendReply(webkit_glue::WebIntentReply(reply_type, data)); | |
64 } | |
65 | |
66 virtual void SendReply(const webkit_glue::WebIntentReply& reply) OVERRIDE { | 60 virtual void SendReply(const webkit_glue::WebIntentReply& reply) OVERRIDE { |
67 reply_.reset(new webkit_glue::WebIntentReply(reply)); | 61 reply_.reset(new webkit_glue::WebIntentReply(reply)); |
68 } | 62 } |
69 | 63 |
70 virtual void RegisterReplyNotification( | 64 virtual void RegisterReplyNotification( |
71 const base::Callback<void(webkit_glue::WebIntentReplyType)>&) OVERRIDE { | 65 const base::Callback<void(webkit_glue::WebIntentReplyType)>&) OVERRIDE { |
72 } | 66 } |
73 | 67 |
74 webkit_glue::WebIntentData intent_; | 68 webkit_glue::WebIntentData intent_; |
75 | 69 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 factory.CreateServiceInstance(url, intent, tab)); | 200 factory.CreateServiceInstance(url, intent, tab)); |
207 service->HandleIntent(&dispatcher); | 201 service->HandleIntent(&dispatcher); |
208 | 202 |
209 ASSERT_TRUE(dispatcher.reply_); | 203 ASSERT_TRUE(dispatcher.reply_); |
210 EXPECT_EQ( | 204 EXPECT_EQ( |
211 webkit_glue::WebIntentReply( | 205 webkit_glue::WebIntentReply( |
212 webkit_glue::WEB_INTENT_REPLY_FAILURE, | 206 webkit_glue::WEB_INTENT_REPLY_FAILURE, |
213 string16()), | 207 string16()), |
214 *dispatcher.reply_.get()); | 208 *dispatcher.reply_.get()); |
215 } | 209 } |
OLD | NEW |