Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: components/test_runner/web_frame_test_proxy.h

Issue 2338623004: Add Blink setting to block doc.written scripts on 2g-like networks (Closed)
Patch Set: Update test results after rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
6 #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ 6 #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "components/test_runner/test_runner_export.h" 13 #include "components/test_runner/test_runner_export.h"
14 #include "components/test_runner/web_frame_test_client.h" 14 #include "components/test_runner/web_frame_test_client.h"
15 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h"
15 #include "third_party/WebKit/public/platform/WebString.h" 16 #include "third_party/WebKit/public/platform/WebString.h"
16 #include "third_party/WebKit/public/web/WebFrameClient.h" 17 #include "third_party/WebKit/public/web/WebFrameClient.h"
17 #include "third_party/WebKit/public/web/WebLocalFrame.h" 18 #include "third_party/WebKit/public/web/WebLocalFrame.h"
18 19
19 namespace test_runner { 20 namespace test_runner {
20 21
21 class TEST_RUNNER_EXPORT WebFrameTestProxyBase { 22 class TEST_RUNNER_EXPORT WebFrameTestProxyBase {
22 public: 23 public:
23 void set_test_client(std::unique_ptr<WebFrameTestClient> client) { 24 void set_test_client(std::unique_ptr<WebFrameTestClient> client) {
24 DCHECK(client); 25 DCHECK(client);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 } 185 }
185 186
186 blink::WebColorChooser* createColorChooser( 187 blink::WebColorChooser* createColorChooser(
187 blink::WebColorChooserClient* client, 188 blink::WebColorChooserClient* client,
188 const blink::WebColor& initial_color, 189 const blink::WebColor& initial_color,
189 const blink::WebVector<blink::WebColorSuggestion>& suggestions) override { 190 const blink::WebVector<blink::WebColorSuggestion>& suggestions) override {
190 return test_client()->createColorChooser(client, initial_color, 191 return test_client()->createColorChooser(client, initial_color,
191 suggestions); 192 suggestions);
192 } 193 }
193 194
195 blink::WebEffectiveConnectionType getEffectiveConnectionType() override {
196 if (test_client()->getEffectiveConnectionType() !=
197 blink::WebEffectiveConnectionType::TypeUnknown) {
198 return test_client()->getEffectiveConnectionType();
199 }
200 return Base::getEffectiveConnectionType();
201 }
202
194 void runModalAlertDialog(const blink::WebString& message) override { 203 void runModalAlertDialog(const blink::WebString& message) override {
195 test_client()->runModalAlertDialog(message); 204 test_client()->runModalAlertDialog(message);
196 } 205 }
197 206
198 bool runModalConfirmDialog(const blink::WebString& message) override { 207 bool runModalConfirmDialog(const blink::WebString& message) override {
199 return test_client()->runModalConfirmDialog(message); 208 return test_client()->runModalConfirmDialog(message);
200 } 209 }
201 210
202 bool runModalPromptDialog(const blink::WebString& message, 211 bool runModalPromptDialog(const blink::WebString& message,
203 const blink::WebString& default_value, 212 const blink::WebString& default_value,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 return test_client()->runFileChooser(params, completion); 299 return test_client()->runFileChooser(params, completion);
291 } 300 }
292 301
293 private: 302 private:
294 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); 303 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy);
295 }; 304 };
296 305
297 } // namespace test_runner 306 } // namespace test_runner
298 307
299 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ 308 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698