Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TEST_MEDIA_ROUTER_MEDIA_ROUTER_INTEGRATION_BROWSERTEST_H_ | 5 #ifndef CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_INTEGRATION_BROWSERTEST_H_ |
| 6 #define CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_INTEGRATION_BROWSERTEST_H_ | 6 #define CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_INTEGRATION_BROWSERTEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 // session. | 80 // session. |
| 81 content::WebContents* StartSessionWithTestPageAndSink(); | 81 content::WebContents* StartSessionWithTestPageAndSink(); |
| 82 | 82 |
| 83 // Opens "basic_test.html," waits for sinks to be available, starts a session, | 83 // Opens "basic_test.html," waits for sinks to be available, starts a session, |
| 84 // and chooses a sink with the name |kTestSinkName|. Also checks that the | 84 // and chooses a sink with the name |kTestSinkName|. Also checks that the |
| 85 // session has successfully started if |should_succeed| is true. | 85 // session has successfully started if |should_succeed| is true. |
| 86 content::WebContents* StartSessionWithTestPageAndChooseSink(); | 86 content::WebContents* StartSessionWithTestPageAndChooseSink(); |
| 87 | 87 |
| 88 void OpenTestPage(base::FilePath::StringPieceType file); | 88 void OpenTestPage(base::FilePath::StringPieceType file); |
| 89 void OpenTestPageInNewTab(base::FilePath::StringPieceType file); | 89 void OpenTestPageInNewTab(base::FilePath::StringPieceType file); |
| 90 virtual GURL GetTestPageUrl(const base::FilePath& full_path); | |
| 90 | 91 |
| 91 void SetTestData(base::FilePath::StringPieceType test_data_file); | 92 void SetTestData(base::FilePath::StringPieceType test_data_file); |
| 92 | 93 |
| 93 // Start session and wait until the pop dialog shows up. | 94 // Start session and wait until the pop dialog shows up. |
| 94 // |web_contents|: The web contents of the test page which invokes the popup | 95 // |web_contents|: The web contents of the test page which invokes the popup |
| 95 // dialog. | 96 // dialog. |
| 96 void StartSession(content::WebContents* web_contents); | 97 void StartSession(content::WebContents* web_contents); |
| 97 | 98 |
| 98 // Open the chrome modal dialog. | 99 // Open the chrome modal dialog. |
| 99 // |web_contents|: The web contents of the test page which invokes the popup | 100 // |web_contents|: The web contents of the test page which invokes the popup |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 MediaRouterDialogControllerImpl* GetControllerForShownDialog( | 146 MediaRouterDialogControllerImpl* GetControllerForShownDialog( |
| 146 content::WebContents* web_contents); | 147 content::WebContents* web_contents); |
| 147 | 148 |
| 148 // Returns the active WebContents for the current window. | 149 // Returns the active WebContents for the current window. |
| 149 content::WebContents* GetActiveWebContents(); | 150 content::WebContents* GetActiveWebContents(); |
| 150 | 151 |
| 151 // Runs a basic test in which a session is created through the MediaRouter | 152 // Runs a basic test in which a session is created through the MediaRouter |
| 152 // dialog, then terminated. | 153 // dialog, then terminated. |
| 153 void RunBasicTest(); | 154 void RunBasicTest(); |
| 154 | 155 |
| 156 // Runs a test in which we start a session and send a message. | |
|
mark a. foltz
2017/04/18 01:03:43
s/session/presentation/g
zhaobin
2017/04/18 03:17:10
Done.
| |
| 157 void RunSendMessageTest(const std::string& message); | |
| 158 | |
| 159 // Runs a test in which we start a session, close it and send a message. | |
| 160 void RunFailToSendMessageTest(); | |
| 161 | |
| 155 // Runs a test in which we start a session and reconnect to it from another | 162 // Runs a test in which we start a session and reconnect to it from another |
| 156 // tab. | 163 // tab. |
| 157 void RunReconnectSessionTest(); | 164 void RunReconnectSessionTest(); |
| 158 | 165 |
| 166 // Runs a test in which we start a session and reconnect to it from the same | |
| 167 // tab. | |
| 168 void RunReconnectSessionSameTabTest(); | |
| 169 | |
| 159 std::string receiver() const { return receiver_; } | 170 std::string receiver() const { return receiver_; } |
| 160 | 171 |
| 161 private: | 172 private: |
| 162 // Get the full path of the resource file. | 173 // Get the full path of the resource file. |
| 163 // |relative_path|: The relative path to | 174 // |relative_path|: The relative path to |
| 164 // <chromium src>/out/<build config>/media_router/ | 175 // <chromium src>/out/<build config>/media_router/ |
| 165 // browser_test_resources/ | 176 // browser_test_resources/ |
| 166 base::FilePath GetResourceFile( | 177 base::FilePath GetResourceFile( |
| 167 base::FilePath::StringPieceType relative_path) const; | 178 base::FilePath::StringPieceType relative_path) const; |
| 168 | 179 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 180 Browser* browser() override; | 191 Browser* browser() override; |
| 181 | 192 |
| 182 private: | 193 private: |
| 183 Browser* incognito_browser_ = nullptr; | 194 Browser* incognito_browser_ = nullptr; |
| 184 std::string incognito_extension_id_; | 195 std::string incognito_extension_id_; |
| 185 }; | 196 }; |
| 186 | 197 |
| 187 } // namespace media_router | 198 } // namespace media_router |
| 188 | 199 |
| 189 #endif // CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_INTEGRATION_BROWSERTEST_H_ | 200 #endif // CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_INTEGRATION_BROWSERTEST_H_ |
| OLD | NEW |