OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/extensions/extension_browsertest.h" | 13 #include "chrome/browser/extensions/extension_browsertest.h" |
14 #include "chrome/common/notification_service.h" | |
15 | 14 |
16 class Extension; | 15 class Extension; |
17 | 16 |
18 // The general flow of these API tests should work like this: | 17 // The general flow of these API tests should work like this: |
19 // (1) Setup initial browser state (e.g. create some bookmarks for the | 18 // (1) Setup initial browser state (e.g. create some bookmarks for the |
20 // bookmark test) | 19 // bookmark test) |
21 // (2) Call ASSERT_TRUE(RunExtensionTest(name)); | 20 // (2) Call ASSERT_TRUE(RunExtensionTest(name)); |
22 // (3) In your extension code, run your test and call chrome.test.pass or | 21 // (3) In your extension code, run your test and call chrome.test.pass or |
23 // chrome.test.fail | 22 // chrome.test.fail |
24 // (4) Verify expected browser state. | 23 // (4) Verify expected browser state. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 bool RunExtensionTestImpl(const char* extension_name, | 105 bool RunExtensionTestImpl(const char* extension_name, |
107 const std::string& test_page, | 106 const std::string& test_page, |
108 bool enable_incogntio); | 107 bool enable_incogntio); |
109 | 108 |
110 // Hold details of the test, set in C++, which can be accessed by | 109 // Hold details of the test, set in C++, which can be accessed by |
111 // javascript using chrome.test.getConfig(). | 110 // javascript using chrome.test.getConfig(). |
112 scoped_ptr<DictionaryValue> test_config_; | 111 scoped_ptr<DictionaryValue> test_config_; |
113 }; | 112 }; |
114 | 113 |
115 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ | 114 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ |
OLD | NEW |