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

Unified Diff: content/public/test/browser_test_utils.h

Issue 10916334: Enable webgl conformance tests under content/test/gpu in content_browsertests (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: namespace fixup Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_utils.h
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h
index 83ea128e9c5f8a1c7bb6faea38b374be7b770563..b807e3194aab4be867adf93569dd1a7048a1a30a 100644
--- a/content/public/test/browser_test_utils.h
+++ b/content/public/test/browser_test_utils.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
#define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
+#include <queue>
#include <string>
#include <vector>
@@ -212,6 +213,37 @@ class TestWebSocketServer {
DISALLOW_COPY_AND_ASSIGN(TestWebSocketServer);
};
+// Watches for responses from the DOMAutomationController and keeps them in a
+// queue. Useful for waiting for a message to be received.
+class DOMMessageQueue : public NotificationObserver {
+ public:
+ // Constructs a DOMMessageQueue and begins listening for messages from the
+ // DOMAutomationController. Do not construct this until the browser has
+ // started.
+ DOMMessageQueue();
+ virtual ~DOMMessageQueue();
+
+ // Removes all messages in the message queue.
+ void ClearQueue();
+
+ // Wait for the next message to arrive. |message| will be set to the next
+ // message, if not null. Returns true on success.
+ bool WaitForMessage(std::string* message) WARN_UNUSED_RESULT;
+
+ // Overridden NotificationObserver methods.
+ virtual void Observe(int type,
+ const NotificationSource& source,
+ const NotificationDetails& details) OVERRIDE;
+
+ private:
+ NotificationRegistrar registrar_;
+ std::queue<std::string> message_queue_;
+ bool waiting_for_message_;
+ scoped_refptr<MessageLoopRunner> message_loop_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(DOMMessageQueue);
+};
+
} // namespace content
#endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698