| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_ |
| 6 #define CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_ | 6 #define CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // for this is that we don't want to burden regular chrome devs with downloading | 24 // for this is that we don't want to burden regular chrome devs with downloading |
| 25 // these sizable reference files by default. | 25 // these sizable reference files by default. |
| 26 bool HasReferenceFilesInCheckout(); | 26 bool HasReferenceFilesInCheckout(); |
| 27 | 27 |
| 28 // Verifies both the YUV and Y4M version of the reference file exists. | 28 // Verifies both the YUV and Y4M version of the reference file exists. |
| 29 bool HasYuvAndY4mFile(const base::FilePath::CharType* reference_file); | 29 bool HasYuvAndY4mFile(const base::FilePath::CharType* reference_file); |
| 30 | 30 |
| 31 // Retrieves the reference files dir, to which file names can be appended. | 31 // Retrieves the reference files dir, to which file names can be appended. |
| 32 base::FilePath GetReferenceFilesDir(); | 32 base::FilePath GetReferenceFilesDir(); |
| 33 | 33 |
| 34 // Retrieves a tool binary path from chrome/test/data/webrtc/resources/tools, |
| 35 // according to platform. If we're running on Linux, requesting pesq will yield |
| 36 // chrome/test/data/webrtc/resources/tools/linux/pesq, whereas the same call on |
| 37 // Windows will yield chrome/test/data/webrtc/resources/tools/win/pesq.exe. |
| 38 // This function does not check the binary actually exists. |
| 39 base::FilePath GetToolForPlatform(const std::string& tool_name); |
| 40 |
| 34 extern const base::FilePath::CharType kReferenceFileName360p[]; | 41 extern const base::FilePath::CharType kReferenceFileName360p[]; |
| 35 extern const base::FilePath::CharType kReferenceFileName720p[]; | 42 extern const base::FilePath::CharType kReferenceFileName720p[]; |
| 36 extern const base::FilePath::CharType kYuvFileExtension[]; | 43 extern const base::FilePath::CharType kYuvFileExtension[]; |
| 37 extern const base::FilePath::CharType kY4mFileExtension[]; | 44 extern const base::FilePath::CharType kY4mFileExtension[]; |
| 38 | 45 |
| 39 // Executes javascript code which will sleep for |timeout_msec| milliseconds. | 46 // Executes javascript code which will sleep for |timeout_msec| milliseconds. |
| 40 // Returns true on success. | 47 // Returns true on success. |
| 41 bool SleepInJavascript(content::WebContents* tab_contents, int timeout_msec); | 48 bool SleepInJavascript(content::WebContents* tab_contents, int timeout_msec); |
| 42 | 49 |
| 43 // This function will execute the provided |javascript| until it causes a call | 50 // This function will execute the provided |javascript| until it causes a call |
| 44 // to window.domAutomationController.send() with |evaluates_to| as the message. | 51 // to window.domAutomationController.send() with |evaluates_to| as the message. |
| 45 // That is, we are NOT checking what the javascript evaluates to. Returns false | 52 // That is, we are NOT checking what the javascript evaluates to. Returns false |
| 46 // if we exceed the TestTimeouts::action_max_timeout(). | 53 // if we exceed the TestTimeouts::action_max_timeout(). |
| 47 // TODO(phoglund): Consider a better interaction method with the javascript | 54 // TODO(phoglund): Consider a better interaction method with the javascript |
| 48 // than polling javascript methods. | 55 // than polling javascript methods. |
| 49 bool PollingWaitUntil(const std::string& javascript, | 56 bool PollingWaitUntil(const std::string& javascript, |
| 50 const std::string& evaluates_to, | 57 const std::string& evaluates_to, |
| 51 content::WebContents* tab_contents); | 58 content::WebContents* tab_contents); |
| 52 bool PollingWaitUntil(const std::string& javascript, | 59 bool PollingWaitUntil(const std::string& javascript, |
| 53 const std::string& evaluates_to, | 60 const std::string& evaluates_to, |
| 54 content::WebContents* tab_contents, | 61 content::WebContents* tab_contents, |
| 55 int poll_interval_msec); | 62 int poll_interval_msec); |
| 56 | 63 |
| 57 } // namespace test | 64 } // namespace test |
| 58 | 65 |
| 59 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_ | 66 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_ |
| OLD | NEW |