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

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox_browsertest.h

Issue 320753002: Support javascript gtests in an extension background page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WS Created 6 years, 6 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
Index: chrome/browser/resources/chromeos/chromevox/chromevox_browsertest.h
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox_browsertest.h b/chrome/browser/resources/chromeos/chromevox/chromevox_browsertest.h
new file mode 100644
index 0000000000000000000000000000000000000000..5aac444f7fab521b1d247760d47ae43de48000e7
--- /dev/null
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox_browsertest.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_RESOURCES_CHROMEOS_CHROMEVOX_CHROMEVOX_BROWSERTEST_H_
+#define CHROME_BROWSER_RESOURCES_CHROMEOS_CHROMEVOX_CHROMEVOX_BROWSERTEST_H_
+
+#include "chrome/test/base/javascript_browsertest.h"
+#include "content/public/browser/notification_registrar.h"
+#include "content/public/test/test_utils.h"
+
+// A super class that handles javascript-based tests against the ChromeVox
+// component extension.
+class ChromeVoxBrowserTest : public JavaScriptBrowserTest,
+ public content::NotificationObserver {
+ public:
+ ChromeVoxBrowserTest() : libs_loaded_(false) {}
+
+ virtual ~ChromeVoxBrowserTest() {}
+
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details);
+
+ protected:
+ // Methods InProcessBrowserTest overrides.
+ virtual void SetUpOnMainThread() OVERRIDE;
+
+ // Implicit overrides assumed by js2gtest.
Peter Lundblad 2014/06/08 23:27:21 I don't know what an implicit override is. Can yo
David Tseng 2014/06/10 05:35:21 Done.
+ // Runs |test_fixture|.|test_name| using the framework in test_api.js.
+ bool RunJavascriptTestF(bool is_async,
+ const std::string& test_fixture,
+ const std::string& test_name);
+
+ private:
+ content::NotificationRegistrar registrar_;
+ scoped_refptr<content::MessageLoopRunner> chromevox_load_looper_;
+ bool libs_loaded_;
+ DISALLOW_COPY_AND_ASSIGN(ChromeVoxBrowserTest);
Peter Lundblad 2014/06/08 23:27:21 nit: blank line before this one.
David Tseng 2014/06/10 05:35:21 Done.
+};
+
+#endif // CHROME_BROWSER_RESOURCES_CHROMEOS_CHROMEVOX_CHROMEVOX_BROWSERTEST_H_

Powered by Google App Engine
This is Rietveld 408576698