-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathchrome_desktop_impl.h
75 lines (61 loc) · 2.54 KB
/
chrome_desktop_impl.h
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
75
// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_DESKTOP_IMPL_H_
#define CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_DESKTOP_IMPL_H_
#include <memory>
#include <string>
#include <vector>
#include "base/command_line.h"
#include "base/process/process.h"
#include "chrome/test/chromedriver/chrome/chrome_impl.h"
#include "chrome/test/chromedriver/chrome/scoped_temp_dir_with_retry.h"
namespace base {
class TimeDelta;
}
class DevToolsClient;
class Status;
class ChromeDesktopImpl : public ChromeImpl {
public:
ChromeDesktopImpl(BrowserInfo browser_info,
std::set<WebViewInfo::Type> window_types,
std::unique_ptr<DevToolsClient> websocket_client,
std::vector<std::unique_ptr<DevToolsEventListener>>
devtools_event_listeners,
std::optional<MobileDevice> mobile_device,
std::string page_load_strategy,
base::Process process,
const base::CommandLine& command,
base::ScopedTempDir* user_data_dir,
base::ScopedTempDir* extension_dir,
bool network_emulation_enabled,
bool autoaccept_beforeunload,
bool enable_extension_targets,
bool quit_gracefully);
~ChromeDesktopImpl() override;
// Waits for an extension's page with the given URL to appear and finish
// loading. Returns an error if the timeout is exceeded.
Status WaitForExtensionPageToLoad(const std::string& url,
const base::TimeDelta& timeout,
bool w3c_compliant);
// Overridden from Chrome:
Status GetAsDesktop(ChromeDesktopImpl** desktop) override;
std::string GetOperatingSystemName() override;
// Overridden from ChromeImpl:
bool IsMobileEmulationEnabled() const override;
bool HasTouchScreen() const override;
Status QuitImpl() override;
const base::CommandLine& command() const;
bool IsNetworkConnectionEnabled() const;
int GetNetworkConnection() const;
void SetNetworkConnection(int network_connection);
private:
base::Process process_;
base::CommandLine command_;
ScopedTempDirWithRetry user_data_dir_;
ScopedTempDirWithRetry extension_dir_;
bool network_connection_enabled_;
int network_connection_;
bool quit_gracefully_;
};
#endif // CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_DESKTOP_IMPL_H_