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

Unified Diff: chrome/test/ppapi/ppapi_test.h

Issue 10699045: Fix PPB_MouseLock.LockMouse crash and add tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « chrome/test/ppapi/ppapi_interactive_browsertest.cc ('k') | chrome/test/ppapi/ppapi_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ppapi/ppapi_test.h
===================================================================
--- chrome/test/ppapi/ppapi_test.h (revision 0)
+++ chrome/test/ppapi/ppapi_test.h (working copy)
@@ -2,14 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_TEST_UI_PPAPI_UITEST_H_
-#define CHROME_TEST_UI_PPAPI_UITEST_H_
+#ifndef CHROME_TEST_PPAPI_PPAPI_TEST_H_
+#define CHROME_TEST_PPAPI_PPAPI_TEST_H_
#pragma once
#include <string>
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/timer.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+namespace content {
+class RenderViewHost;
+}
+
class PPAPITestBase : public InProcessBrowserTest {
public:
PPAPITestBase();
@@ -33,6 +42,34 @@
std::string StripPrefixes(const std::string& test_name);
protected:
+ class TestFinishObserver : public content::NotificationObserver {
+ public:
+ TestFinishObserver(content::RenderViewHost* render_view_host,
+ int timeout_s);
+
+ bool WaitForFinish();
+
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ std::string result() const { return result_; }
+
+ void Reset();
+
+ private:
+ void OnTimeout();
+
+ bool finished_;
+ bool waiting_;
+ int timeout_s_;
+ std::string result_;
+ content::NotificationRegistrar registrar_;
+ base::RepeatingTimer<TestFinishObserver> timer_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestFinishObserver);
+ };
+
// Runs the test for a tab given the tab that's already navigated to the
// given URL.
void RunTestURL(const GURL& test_url);
@@ -96,4 +133,4 @@
const std::string& test_case) OVERRIDE;
};
-#endif // CHROME_TEST_UI_PPAPI_UITEST_H_
+#endif // CHROME_TEST_PPAPI_PPAPI_TEST_H_
« no previous file with comments | « chrome/test/ppapi/ppapi_interactive_browsertest.cc ('k') | chrome/test/ppapi/ppapi_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698