forked from nwjs/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmock_content_settings_client.h
More file actions
48 lines (35 loc) · 1.7 KB
/
mock_content_settings_client.h
File metadata and controls
48 lines (35 loc) · 1.7 KB
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
// Copyright 2014 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 CONTENT_SHELL_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_
#define CONTENT_SHELL_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_
#include "base/macros.h"
#include "third_party/blink/public/platform/web_content_settings_client.h"
namespace test_runner {
class LayoutTestRuntimeFlags;
class WebTestDelegate;
class MockContentSettingsClient : public blink::WebContentSettingsClient {
public:
// Caller has to guarantee that |layout_test_runtime_flags| lives longer
// than the MockContentSettingsClient being constructed here.
MockContentSettingsClient(LayoutTestRuntimeFlags* layout_test_runtime_flags);
~MockContentSettingsClient() override;
// blink::WebContentSettingsClient:
bool AllowImage(bool enabled_per_settings,
const blink::WebURL& image_url) override;
bool AllowScript(bool enabled_per_settings) override;
bool AllowScriptFromSource(bool enabled_per_settings,
const blink::WebURL& script_url) override;
bool AllowStorage(bool local) override;
bool AllowRunningInsecureContent(bool enabled_per_settings,
const blink::WebSecurityOrigin& context,
const blink::WebURL& url) override;
bool AllowAutoplay(bool default_value) override;
void SetDelegate(WebTestDelegate* delegate);
private:
WebTestDelegate* delegate_;
LayoutTestRuntimeFlags* flags_;
DISALLOW_COPY_AND_ASSIGN(MockContentSettingsClient);
};
} // namespace test_runner
#endif // CONTENT_SHELL_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_