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

Side by Side Diff: chrome/test/base/extension_js_browser_test.h

Issue 320753002: Support javascript gtests in an extension background page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixup comment 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_TEST_BASE_EXTENSION_JS_BROWSER_TEST_H_
6 #define CHROME_TEST_BASE_EXTENSION_JS_BROWSER_TEST_H_
7
8 #include "chrome/test/base/extension_load_waiter.h"
9 #include "chrome/test/base/javascript_browser_test.h"
10
11 // A super class that handles javascript-based tests against an extension.
12 //
13 // To use this class:
14 // Add (or reuse) a WaitFor* method (e.g. WaitForWebStoreExtension) to this
Peter Lundblad 2014/06/11 16:45:05 Seems like the documentation is making forward-loo
Peter Lundblad 2014/06/11 16:45:05 Seems like the documentation is making forward-loo
Peter Lundblad 2014/06/11 16:45:05 Seems like the documentation is making forward-loo
15 // class.
16 // In your js test fixture, add on your prototype:
17 // testGenPreamble: function() {
18 // GEN(' MyLaunchMethod('extension_id');');
19 // GEN(' WaitForWebStoreExtension('extension_id');');
20 // },
21 class ExtensionJSBrowserTest : public JavaScriptBrowserTest {
22 public:
23 ExtensionJSBrowserTest() : libs_loaded_(false) {}
24
25 virtual ~ExtensionJSBrowserTest() {}
26
27 protected:
28 // Waits for an extension to load.
29 void WaitFor(const char* extension_id);
Peter Lundblad 2014/06/11 16:45:05 Call WaitForExtension for clarity. Also, clarify
Peter Lundblad 2014/06/11 16:45:05 Call WaitForExtension for clarity. Also, clarify
Peter Lundblad 2014/06/11 16:45:05 Call WaitForExtension for clarity. Also, clarify
David Tseng 2014/06/11 17:52:54 Ok.
30
31 // Method required for js2gtest.
32 // Runs |test_fixture|.|test_name| using the framework in test_api.js.
33 bool RunJavascriptTestF(bool is_async,
34 const std::string& test_fixture,
35 const std::string& test_name);
36
37 private:
38 ExtensionLoadWaiter load_waiter_;
39 bool libs_loaded_;
40
41 DISALLOW_COPY_AND_ASSIGN(ExtensionJSBrowserTest);
42 };
43
44 #endif // CHROME_TEST_BASE_EXTENSION_JS_BROWSER_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698