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

Unified Diff: components/arc/test/fake_intent_helper_instance.h

Issue 2579193003: arc: Implement more methods in FakeIntentHelperInstance. (Closed)
Patch Set: get std::move-based approach working Created 4 years 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: 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);
};
« no previous file with comments | « no previous file | components/arc/test/fake_intent_helper_instance.cc » ('j') | components/arc/test/fake_intent_helper_instance.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698