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..a1103a6385ea9463b8960cab5af5b997938bdf9d 100644 |
--- a/components/arc/test/fake_intent_helper_instance.h |
+++ b/components/arc/test/fake_intent_helper_instance.h |
@@ -5,6 +5,7 @@ |
#ifndef COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_INSTANCE_H_ |
#define COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_INSTANCE_H_ |
+#include <map> |
#include <string> |
#include <vector> |
@@ -34,9 +35,31 @@ class FakeIntentHelperInstance : public mojom::IntentHelperInstance { |
std::string extras; |
}; |
+ // Parameters passed to HandleIntent(). |
+ struct HandledIntent { |
+ HandledIntent(mojom::IntentInfoPtr intent, |
Luis Héctor Chávez
2016/12/16 16:57:44
You can even get rid of all this boilerplate if yo
Daniel Erat
2016/12/16 17:05:37
hmm. this was the first thing i tried in this chan
Luis Héctor Chávez
2016/12/16 17:16:18
argh, foiled again by the fact that we use multipl
hidehiko
2016/12/16 17:20:12
Oh, you hit https://www.chromium.org/developers/co
|
+ mojom::ActivityNamePtr activity); |
+ HandledIntent(HandledIntent&& other); |
+ HandledIntent& operator=(HandledIntent&& other); |
+ ~HandledIntent(); |
+ |
+ mojom::IntentInfoPtr intent; |
+ mojom::ActivityNamePtr 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 |
+ // RequestIntentHandlerList() calls with intents containing |action|. |
+ void SetIntentHandlers( |
+ const std::string& action, |
+ std::vector<mojom::IntentHandlerInfoPtr> handlers); |
// mojom::IntentHelperInstance: |
~FakeIntentHelperInstance() override; |
@@ -88,6 +111,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>> |
+ intent_handlers_; |
+ |
DISALLOW_COPY_AND_ASSIGN(FakeIntentHelperInstance); |
}; |