OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_PERMISSIONS_PERMISSIONS_BROWSERTEST_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSIONS_BROWSERTEST_H_ |
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSIONS_BROWSERTEST_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSIONS_BROWSERTEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 MockPermissionPromptFactory* prompt_factory() { | 40 MockPermissionPromptFactory* prompt_factory() { |
41 return prompt_factory_.get(); | 41 return prompt_factory_.get(); |
42 } | 42 } |
43 | 43 |
44 protected: | 44 protected: |
45 bool RunScriptReturnBool(const std::string& script); | 45 bool RunScriptReturnBool(const std::string& script); |
46 | 46 |
47 content::WebContents* GetWebContents(); | 47 content::WebContents* GetWebContents(); |
48 | 48 |
| 49 GURL GetTestUrl(); |
| 50 |
49 // Common tests that should be called by subclasses. | 51 // Common tests that should be called by subclasses. |
50 void CommonFailsBeforeRequesting(); | 52 void CommonFailsBeforeRequesting(); |
51 void CommonFailsIfDismissed(); | 53 void CommonFailsIfDismissed(); |
52 void CommonFailsIfBlocked(); | 54 void CommonFailsIfBlocked(); |
53 void CommonSucceedsIfAllowed(); | 55 void CommonSucceedsIfAllowed(); |
54 | 56 |
55 private: | 57 private: |
56 std::string test_url_; | 58 std::string test_url_; |
57 std::unique_ptr<MockPermissionPromptFactory> prompt_factory_; | 59 std::unique_ptr<MockPermissionPromptFactory> prompt_factory_; |
58 }; | 60 }; |
59 | 61 |
60 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSIONS_BROWSERTEST_H_ | 62 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSIONS_BROWSERTEST_H_ |
OLD | NEW |