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

Side by Side Diff: chrome/browser/extensions/extension_apitest.h

Issue 171032: end-to-end extension API tests (Closed)
Patch Set: a bit of refactoring and review feedback Created 11 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_apitest.cc » ('j') | chrome/chrome.gyp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 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_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_
7
8 #include "chrome/browser/extensions/extension_browsertest.h"
9 #include "chrome/common/notification_service.h"
10
11 // The general flow of these API tests should work like this:
12 // (1) Setup initial browser state (e.g. create some bookmarks for the
13 // bookmark test)
14 // (2) Call ASSERT_TRUE(RunExtensionTest(name));
15 // (3) In your extension code, run your test and call chrome.test.pass or
16 // chrome.test.fail
17 // (4) Verify expected browser state.
18 // TODO(erikkay): There should also be a way to drive events in these tests.
19
20 class ExtensionApiTest : public ExtensionBrowserTest {
21 protected:
22 // Load |extension_name| and wait for pass / fail notification.
23 // |extension_name| is a directory in "test/data/extensions/api_test".
24 bool RunExtensionTest(const char* extension_name);
25
26 // Reset |completed_| and wait for a new pass / fail notification.
27 bool WaitForPassFail();
28
29 // All extensions tested by ExtensionApiTest are in the "api_test" dir.
30 virtual void SetUpCommandLine(CommandLine* command_line);
31
32 // NotificationObserver
33 void ExtensionApiTest::Observe(NotificationType type,
34 const NotificationSource& source,
35 const NotificationDetails& details);
36
37 // Did the extension side of the unit test complete?
38 bool completed_;
39
40 // Did the extension side of the unit test pass?
41 bool passed_;
42
43 // If it failed, what was the error message?
44 std::string message_;
45 };
46
47 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_apitest.cc » ('j') | chrome/chrome.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698