Chromium Code Reviews| Index: components/arc/test/fake_intent_helper_instance.h |
| diff --git a/components/arc/test/fake_intent_helper_instance.h b/components/arc/test/fake_intent_helper_instance.h |
| index a0316800c5c51040b5179bb3e50addd309cd1390..0f69358702fc3c09a57002cfc32a4067216937be 100644 |
| --- a/components/arc/test/fake_intent_helper_instance.h |
| +++ b/components/arc/test/fake_intent_helper_instance.h |
| @@ -34,9 +34,38 @@ class FakeIntentHelperInstance : public mojom::IntentHelperInstance { |
| std::string extras; |
| }; |
| + // Parameters passed to HandleIntent(). Optional fields are saved as empty |
| + // strings. |
| + struct HandledIntent { |
|
Daniel Erat
2016/12/16 02:29:03
i tried hard to make this class have IntentInfoPtr
hidehiko
2016/12/16 04:27:12
How about;
struct HandledIntent {
HandledIntent
Daniel Erat
2016/12/16 05:41:04
i tried something similar to this earlier, but i'm
hidehiko
2016/12/16 06:30:20
Wow, the copied error message is very easy to unde
|
| + HandledIntent(const mojom::IntentInfoPtr& intent, |
| + const mojom::ActivityNamePtr& activity); |
| + HandledIntent(const HandledIntent& other); |
| + ~HandledIntent(); |
| + |
| + std::string action; |
| + std::vector<std::string> categories; |
| + std::string data; |
| + std::string type; |
| + std::string clip_data_uri; |
| + std::string package; |
| + std::string activity; |
| + }; |
| + |
| void clear_broadcasts() { broadcasts_.clear(); } |
| + void clear_handled_intents() { handled_intents_.clear(); } |
| const std::vector<Broadcast>& broadcasts() const { return broadcasts_; } |
| + const std::vector<HandledIntent>& handled_intents() const { |
| + return handled_intents_; |
| + } |
| + |
| + // Sets a list of intent handlers to be returned in response to a |
| + // RequestIntentHandlerList() call with an intent containing |action|. Note |
| + // that the handlers will need to be set again after the |
| + // RequestIntentHandlerList() call is made. |
|
Daniel Erat
2016/12/16 02:29:03
do you know of any way to duplicate the IntentHand
hidehiko
2016/12/16 04:27:12
IntentHandlerInfoPtr::Clone() is what you need?
ht
Daniel Erat
2016/12/16 05:41:04
thanks, i missed this when i was looking through t
|
| + void SetIntentHandlers( |
| + const std::string& action, |
| + std::vector<mojom::IntentHandlerInfoPtr> handlers); |
| // mojom::IntentHelperInstance: |
| ~FakeIntentHelperInstance() override; |
| @@ -88,6 +117,14 @@ class FakeIntentHelperInstance : public mojom::IntentHelperInstance { |
| private: |
| std::vector<Broadcast> broadcasts_; |
| + // Information about calls to HandleIntent(). |
| + std::vector<HandledIntent> handled_intents_; |
| + |
| + // Map from action names to intent handlers to be returned by |
| + // RequestIntentHandlerList(). |
| + std::map<std::string, std::vector<mojom::IntentHandlerInfoPtr>> |
|
hidehiko
2016/12/16 04:27:12
Could you add #include <map>?
Daniel Erat
2016/12/16 05:41:04
whoops, done.
|
| + intent_handlers_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(FakeIntentHelperInstance); |
| }; |