OLD | NEW |
---|---|
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 #include "components/test_runner/test_runner.h" | 5 #include "components/test_runner/test_runner.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 const std::string& platform); | 190 const std::string& platform); |
191 void RunIdleTasks(v8::Local<v8::Function> callback); | 191 void RunIdleTasks(v8::Local<v8::Function> callback); |
192 void SendBluetoothManualChooserEvent(const std::string& event, | 192 void SendBluetoothManualChooserEvent(const std::string& event, |
193 const std::string& argument); | 193 const std::string& argument); |
194 void SetAcceptLanguages(const std::string& accept_languages); | 194 void SetAcceptLanguages(const std::string& accept_languages); |
195 void SetAllowDisplayOfInsecureContent(bool allowed); | 195 void SetAllowDisplayOfInsecureContent(bool allowed); |
196 void SetAllowFileAccessFromFileURLs(bool allow); | 196 void SetAllowFileAccessFromFileURLs(bool allow); |
197 void SetAllowRunningOfInsecureContent(bool allowed); | 197 void SetAllowRunningOfInsecureContent(bool allowed); |
198 void SetAutoplayAllowed(bool allowed); | 198 void SetAutoplayAllowed(bool allowed); |
199 void SetAllowUniversalAccessFromFileURLs(bool allow); | 199 void SetAllowUniversalAccessFromFileURLs(bool allow); |
200 void SetAlwaysAcceptCookies(bool accept); | 200 void SetBlockThirdPartyCookies(bool block); |
201 void SetAudioData(const gin::ArrayBufferView& view); | 201 void SetAudioData(const gin::ArrayBufferView& view); |
202 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); | 202 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); |
203 void SetBluetoothFakeAdapter(const std::string& adapter_name, | 203 void SetBluetoothFakeAdapter(const std::string& adapter_name, |
204 v8::Local<v8::Function> callback); | 204 v8::Local<v8::Function> callback); |
205 void SetBluetoothManualChooser(bool enable); | 205 void SetBluetoothManualChooser(bool enable); |
206 void SetCanOpenWindows(); | 206 void SetCanOpenWindows(); |
207 void SetCloseRemainingWindowsWhenComplete(gin::Arguments* args); | 207 void SetCloseRemainingWindowsWhenComplete(gin::Arguments* args); |
208 void SetColorProfile(const std::string& name, | 208 void SetColorProfile(const std::string& name, |
209 v8::Local<v8::Function> callback); | 209 v8::Local<v8::Function> callback); |
210 void SetCustomPolicyDelegate(gin::Arguments* args); | 210 void SetCustomPolicyDelegate(gin::Arguments* args); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 .SetMethod("setAcceptLanguages", &TestRunnerBindings::SetAcceptLanguages) | 485 .SetMethod("setAcceptLanguages", &TestRunnerBindings::SetAcceptLanguages) |
486 .SetMethod("setAllowDisplayOfInsecureContent", | 486 .SetMethod("setAllowDisplayOfInsecureContent", |
487 &TestRunnerBindings::SetAllowDisplayOfInsecureContent) | 487 &TestRunnerBindings::SetAllowDisplayOfInsecureContent) |
488 .SetMethod("setAllowFileAccessFromFileURLs", | 488 .SetMethod("setAllowFileAccessFromFileURLs", |
489 &TestRunnerBindings::SetAllowFileAccessFromFileURLs) | 489 &TestRunnerBindings::SetAllowFileAccessFromFileURLs) |
490 .SetMethod("setAllowRunningOfInsecureContent", | 490 .SetMethod("setAllowRunningOfInsecureContent", |
491 &TestRunnerBindings::SetAllowRunningOfInsecureContent) | 491 &TestRunnerBindings::SetAllowRunningOfInsecureContent) |
492 .SetMethod("setAutoplayAllowed", &TestRunnerBindings::SetAutoplayAllowed) | 492 .SetMethod("setAutoplayAllowed", &TestRunnerBindings::SetAutoplayAllowed) |
493 .SetMethod("setAllowUniversalAccessFromFileURLs", | 493 .SetMethod("setAllowUniversalAccessFromFileURLs", |
494 &TestRunnerBindings::SetAllowUniversalAccessFromFileURLs) | 494 &TestRunnerBindings::SetAllowUniversalAccessFromFileURLs) |
495 .SetMethod("setAlwaysAcceptCookies", | 495 .SetMethod("setBlockThirdPartyCookies", |
496 &TestRunnerBindings::SetAlwaysAcceptCookies) | 496 &TestRunnerBindings::SetBlockThirdPartyCookies) |
497 .SetMethod("setAudioData", &TestRunnerBindings::SetAudioData) | 497 .SetMethod("setAudioData", &TestRunnerBindings::SetAudioData) |
498 .SetMethod("setBackingScaleFactor", | 498 .SetMethod("setBackingScaleFactor", |
499 &TestRunnerBindings::SetBackingScaleFactor) | 499 &TestRunnerBindings::SetBackingScaleFactor) |
500 // The Bluetooth functions are specified at | 500 // The Bluetooth functions are specified at |
501 // https://webbluetoothcg.github.io/web-bluetooth/tests/. | 501 // https://webbluetoothcg.github.io/web-bluetooth/tests/. |
502 .SetMethod("setBluetoothFakeAdapter", | 502 .SetMethod("setBluetoothFakeAdapter", |
503 &TestRunnerBindings::SetBluetoothFakeAdapter) | 503 &TestRunnerBindings::SetBluetoothFakeAdapter) |
504 .SetMethod("setBluetoothManualChooser", | 504 .SetMethod("setBluetoothManualChooser", |
505 &TestRunnerBindings::SetBluetoothManualChooser) | 505 &TestRunnerBindings::SetBluetoothManualChooser) |
506 .SetMethod("setCallCloseOnWebViews", &TestRunnerBindings::NotImplemented) | 506 .SetMethod("setCallCloseOnWebViews", &TestRunnerBindings::NotImplemented) |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1257 void TestRunnerBindings::ClearAllDatabases() { | 1257 void TestRunnerBindings::ClearAllDatabases() { |
1258 if (runner_) | 1258 if (runner_) |
1259 runner_->ClearAllDatabases(); | 1259 runner_->ClearAllDatabases(); |
1260 } | 1260 } |
1261 | 1261 |
1262 void TestRunnerBindings::SetDatabaseQuota(int quota) { | 1262 void TestRunnerBindings::SetDatabaseQuota(int quota) { |
1263 if (runner_) | 1263 if (runner_) |
1264 runner_->SetDatabaseQuota(quota); | 1264 runner_->SetDatabaseQuota(quota); |
1265 } | 1265 } |
1266 | 1266 |
1267 void TestRunnerBindings::SetAlwaysAcceptCookies(bool accept) { | 1267 void TestRunnerBindings::SetBlockThirdPartyCookies(bool block) { |
1268 if (runner_) | 1268 if (runner_) |
1269 runner_->SetAlwaysAcceptCookies(accept); | 1269 runner_->SetBlockThirdPartyCookies(block); |
1270 } | 1270 } |
1271 | 1271 |
1272 void TestRunnerBindings::SetWindowIsKey(bool value) { | 1272 void TestRunnerBindings::SetWindowIsKey(bool value) { |
1273 if (view_runner_) | 1273 if (view_runner_) |
1274 view_runner_->SetWindowIsKey(value); | 1274 view_runner_->SetWindowIsKey(value); |
1275 } | 1275 } |
1276 | 1276 |
1277 std::string TestRunnerBindings::PathToLocalResource(const std::string& path) { | 1277 std::string TestRunnerBindings::PathToLocalResource(const std::string& path) { |
1278 if (runner_) | 1278 if (runner_) |
1279 return runner_->PathToLocalResource(path); | 1279 return runner_->PathToLocalResource(path); |
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2600 } | 2600 } |
2601 | 2601 |
2602 void TestRunner::ClearAllDatabases() { | 2602 void TestRunner::ClearAllDatabases() { |
2603 delegate_->ClearAllDatabases(); | 2603 delegate_->ClearAllDatabases(); |
2604 } | 2604 } |
2605 | 2605 |
2606 void TestRunner::SetDatabaseQuota(int quota) { | 2606 void TestRunner::SetDatabaseQuota(int quota) { |
2607 delegate_->SetDatabaseQuota(quota); | 2607 delegate_->SetDatabaseQuota(quota); |
2608 } | 2608 } |
2609 | 2609 |
2610 void TestRunner::SetAlwaysAcceptCookies(bool accept) { | 2610 void TestRunner::SetBlockThirdPartyCookies(bool block) { |
2611 delegate_->SetAcceptAllCookies(accept); | 2611 delegate_->SetAcceptAllCookies(!block); |
Mike West
2016/07/05 08:42:23
Nit: Why not change the name up through the delega
tyoshino (SeeGerritForStatus)
2016/07/05 14:17:12
Done.
| |
2612 } | 2612 } |
2613 | 2613 |
2614 void TestRunner::SetFocus(blink::WebView* web_view, bool focus) { | 2614 void TestRunner::SetFocus(blink::WebView* web_view, bool focus) { |
2615 if (focus) { | 2615 if (focus) { |
2616 if (previously_focused_view_ != web_view) { | 2616 if (previously_focused_view_ != web_view) { |
2617 delegate_->SetFocus(previously_focused_view_, false); | 2617 delegate_->SetFocus(previously_focused_view_, false); |
2618 delegate_->SetFocus(web_view, true); | 2618 delegate_->SetFocus(web_view, true); |
2619 previously_focused_view_ = web_view; | 2619 previously_focused_view_ = web_view; |
2620 } | 2620 } |
2621 } else { | 2621 } else { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2734 | 2734 |
2735 void TestRunner::NotifyDone() { | 2735 void TestRunner::NotifyDone() { |
2736 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2736 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
2737 work_queue_.is_empty()) | 2737 work_queue_.is_empty()) |
2738 delegate_->TestFinished(); | 2738 delegate_->TestFinished(); |
2739 layout_test_runtime_flags_.set_wait_until_done(false); | 2739 layout_test_runtime_flags_.set_wait_until_done(false); |
2740 OnLayoutTestRuntimeFlagsChanged(); | 2740 OnLayoutTestRuntimeFlagsChanged(); |
2741 } | 2741 } |
2742 | 2742 |
2743 } // namespace test_runner | 2743 } // namespace test_runner |
OLD | NEW |