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 | |
51 // Common tests that should be called by subclasses. | 49 // Common tests that should be called by subclasses. |
52 void CommonFailsBeforeRequesting(); | 50 void CommonFailsBeforeRequesting(); |
53 void CommonFailsIfDismissed(); | 51 void CommonFailsIfDismissed(); |
54 void CommonFailsIfBlocked(); | 52 void CommonFailsIfBlocked(); |
55 void CommonSucceedsIfAllowed(); | 53 void CommonSucceedsIfAllowed(); |
56 | 54 |
57 private: | 55 private: |
58 std::string test_url_; | 56 std::string test_url_; |
59 std::unique_ptr<MockPermissionPromptFactory> prompt_factory_; | 57 std::unique_ptr<MockPermissionPromptFactory> prompt_factory_; |
60 }; | 58 }; |
61 | 59 |
62 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSIONS_BROWSERTEST_H_ | 60 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSIONS_BROWSERTEST_H_ |
OLD | NEW |