blob: 12b130d4422ed3c5c0ed3f7bd949fcf0c36492f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_
#define CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_
#include <string>
#include "base/files/file_path.h"
#include "base/process/process_handle.h"
namespace content {
class WebContents;
}
namespace test {
// Reference file locations.
// Checks if the user has the reference files directory, returns true if so.
// If the user's checkout don't have these dirs, they need to configure their
// .gclient as described in chrome/test/data/webrtc/resources/README. The reason
// for this is that we don't want to burden regular chrome devs with downloading
// these sizable reference files by default.
bool HasReferenceFilesInCheckout();
// Retrieves the reference files dir, to which file names can be appended.
base::FilePath GetReferenceFilesDir();
extern const base::FilePath::CharType kReferenceFileName360p[];
extern const base::FilePath::CharType kYuvFileExtension[];
extern const base::FilePath::CharType kY4mFileExtension[];
// Executes javascript code which will sleep for |timeout_msec| milliseconds.
// Returns true on success.
bool SleepInJavascript(content::WebContents* tab_contents, int timeout_msec);
// This function will execute the provided |javascript| until it causes a call
// to window.domAutomationController.send() with |evaluates_to| as the message.
// That is, we are NOT checking what the javascript evaluates to. Returns false
// if we exceed the TestTimeouts::action_max_timeout().
// TODO(phoglund): Consider a better interaction method with the javascript
// than polling javascript methods.
bool PollingWaitUntil(const std::string& javascript,
const std::string& evaluates_to,
content::WebContents* tab_contents);
bool PollingWaitUntil(const std::string& javascript,
const std::string& evaluates_to,
content::WebContents* tab_contents,
int poll_interval_msec);
class PeerConnectionServerRunner {
public:
static const char kDefaultPort[];
PeerConnectionServerRunner(): server_pid_(0) {}
~PeerConnectionServerRunner() {}
// Starts the peerconnection server on localhost on |kDefaultPort|.
bool Start();
// Stops the peerconnection server.
bool Stop();
static void KillAllPeerConnectionServers();
private:
base::ProcessHandle server_pid_;
};
} // namespace test
#endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_
|