| 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 "content/shell/renderer/test_runner/test_runner.h" | 5 #include "content/shell/renderer/test_runner/test_runner.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/public/test/layouttest_support.h" | 10 #include "content/public/test/layouttest_support.h" |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 void GetManifestThen(v8::Handle<v8::Function> callback); | 290 void GetManifestThen(v8::Handle<v8::Function> callback); |
| 291 void CapturePixelsAsyncThen(v8::Handle<v8::Function> callback); | 291 void CapturePixelsAsyncThen(v8::Handle<v8::Function> callback); |
| 292 void CopyImageAtAndCapturePixelsAsyncThen(int x, | 292 void CopyImageAtAndCapturePixelsAsyncThen(int x, |
| 293 int y, | 293 int y, |
| 294 v8::Handle<v8::Function> callback); | 294 v8::Handle<v8::Function> callback); |
| 295 void SetCustomTextOutput(std::string output); | 295 void SetCustomTextOutput(std::string output); |
| 296 void SetViewSourceForFrame(const std::string& name, bool enabled); | 296 void SetViewSourceForFrame(const std::string& name, bool enabled); |
| 297 void SetMockPushClientSuccess(const std::string& endpoint, | 297 void SetMockPushClientSuccess(const std::string& endpoint, |
| 298 const std::string& registration_id); | 298 const std::string& registration_id); |
| 299 void SetMockPushClientError(const std::string& message); | 299 void SetMockPushClientError(const std::string& message); |
| 300 void SetBluetoothMockDataSet(const std::string& dataset_name); |
| 300 | 301 |
| 301 std::string PlatformName(); | 302 std::string PlatformName(); |
| 302 std::string TooltipText(); | 303 std::string TooltipText(); |
| 303 bool DisableNotifyDone(); | 304 bool DisableNotifyDone(); |
| 304 int WebHistoryItemCount(); | 305 int WebHistoryItemCount(); |
| 305 bool InterceptPostMessage(); | 306 bool InterceptPostMessage(); |
| 306 void SetInterceptPostMessage(bool value); | 307 void SetInterceptPostMessage(bool value); |
| 307 | 308 |
| 308 void NotImplemented(const gin::Arguments& args); | 309 void NotImplemented(const gin::Arguments& args); |
| 309 | 310 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 .SetMethod("copyImageAtAndCapturePixelsAsyncThen", | 535 .SetMethod("copyImageAtAndCapturePixelsAsyncThen", |
| 535 &TestRunnerBindings::CopyImageAtAndCapturePixelsAsyncThen) | 536 &TestRunnerBindings::CopyImageAtAndCapturePixelsAsyncThen) |
| 536 .SetMethod("setCustomTextOutput", | 537 .SetMethod("setCustomTextOutput", |
| 537 &TestRunnerBindings::SetCustomTextOutput) | 538 &TestRunnerBindings::SetCustomTextOutput) |
| 538 .SetMethod("setViewSourceForFrame", | 539 .SetMethod("setViewSourceForFrame", |
| 539 &TestRunnerBindings::SetViewSourceForFrame) | 540 &TestRunnerBindings::SetViewSourceForFrame) |
| 540 .SetMethod("setMockPushClientSuccess", | 541 .SetMethod("setMockPushClientSuccess", |
| 541 &TestRunnerBindings::SetMockPushClientSuccess) | 542 &TestRunnerBindings::SetMockPushClientSuccess) |
| 542 .SetMethod("setMockPushClientError", | 543 .SetMethod("setMockPushClientError", |
| 543 &TestRunnerBindings::SetMockPushClientError) | 544 &TestRunnerBindings::SetMockPushClientError) |
| 545 .SetMethod("setBluetoothMockDataSet", |
| 546 &TestRunnerBindings::SetBluetoothMockDataSet) |
| 544 | 547 |
| 545 // Properties. | 548 // Properties. |
| 546 .SetProperty("platformName", &TestRunnerBindings::PlatformName) | 549 .SetProperty("platformName", &TestRunnerBindings::PlatformName) |
| 547 .SetProperty("tooltipText", &TestRunnerBindings::TooltipText) | 550 .SetProperty("tooltipText", &TestRunnerBindings::TooltipText) |
| 548 .SetProperty("disableNotifyDone", &TestRunnerBindings::DisableNotifyDone) | 551 .SetProperty("disableNotifyDone", &TestRunnerBindings::DisableNotifyDone) |
| 549 // webHistoryItemCount is used by tests in LayoutTests\http\tests\history | 552 // webHistoryItemCount is used by tests in LayoutTests\http\tests\history |
| 550 .SetProperty("webHistoryItemCount", | 553 .SetProperty("webHistoryItemCount", |
| 551 &TestRunnerBindings::WebHistoryItemCount) | 554 &TestRunnerBindings::WebHistoryItemCount) |
| 552 .SetProperty("interceptPostMessage", | 555 .SetProperty("interceptPostMessage", |
| 553 &TestRunnerBindings::InterceptPostMessage, | 556 &TestRunnerBindings::InterceptPostMessage, |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1269 if (runner_) | 1272 if (runner_) |
| 1270 runner_->SetBackingScaleFactor(value, callback); | 1273 runner_->SetBackingScaleFactor(value, callback); |
| 1271 } | 1274 } |
| 1272 | 1275 |
| 1273 void TestRunnerBindings::SetColorProfile( | 1276 void TestRunnerBindings::SetColorProfile( |
| 1274 const std::string& name, v8::Handle<v8::Function> callback) { | 1277 const std::string& name, v8::Handle<v8::Function> callback) { |
| 1275 if (runner_) | 1278 if (runner_) |
| 1276 runner_->SetColorProfile(name, callback); | 1279 runner_->SetColorProfile(name, callback); |
| 1277 } | 1280 } |
| 1278 | 1281 |
| 1282 void TestRunnerBindings::SetBluetoothMockDataSet(const std::string& name) { |
| 1283 if (runner_) |
| 1284 runner_->SetBluetoothMockDataSet(name); |
| 1285 } |
| 1286 |
| 1279 void TestRunnerBindings::SetPOSIXLocale(const std::string& locale) { | 1287 void TestRunnerBindings::SetPOSIXLocale(const std::string& locale) { |
| 1280 if (runner_) | 1288 if (runner_) |
| 1281 runner_->SetPOSIXLocale(locale); | 1289 runner_->SetPOSIXLocale(locale); |
| 1282 } | 1290 } |
| 1283 | 1291 |
| 1284 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { | 1292 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { |
| 1285 if (runner_) | 1293 if (runner_) |
| 1286 runner_->SetMIDIAccessorResult(result); | 1294 runner_->SetMIDIAccessorResult(result); |
| 1287 } | 1295 } |
| 1288 | 1296 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1588 // Reset the default quota for each origin to 5MB | 1596 // Reset the default quota for each origin to 5MB |
| 1589 delegate_->SetDatabaseQuota(5 * 1024 * 1024); | 1597 delegate_->SetDatabaseQuota(5 * 1024 * 1024); |
| 1590 delegate_->SetDeviceColorProfile("reset"); | 1598 delegate_->SetDeviceColorProfile("reset"); |
| 1591 delegate_->SetDeviceScaleFactor(1); | 1599 delegate_->SetDeviceScaleFactor(1); |
| 1592 delegate_->SetAcceptAllCookies(false); | 1600 delegate_->SetAcceptAllCookies(false); |
| 1593 delegate_->SetLocale(""); | 1601 delegate_->SetLocale(""); |
| 1594 delegate_->UseUnfortunateSynchronousResizeMode(false); | 1602 delegate_->UseUnfortunateSynchronousResizeMode(false); |
| 1595 delegate_->DisableAutoResizeMode(WebSize()); | 1603 delegate_->DisableAutoResizeMode(WebSize()); |
| 1596 delegate_->DeleteAllCookies(); | 1604 delegate_->DeleteAllCookies(); |
| 1597 delegate_->ResetScreenOrientation(); | 1605 delegate_->ResetScreenOrientation(); |
| 1606 delegate_->SetBluetoothMockDataSet(""); |
| 1598 ResetBatteryStatus(); | 1607 ResetBatteryStatus(); |
| 1599 ResetDeviceLight(); | 1608 ResetDeviceLight(); |
| 1600 } | 1609 } |
| 1601 | 1610 |
| 1602 dump_editting_callbacks_ = false; | 1611 dump_editting_callbacks_ = false; |
| 1603 dump_as_text_ = false; | 1612 dump_as_text_ = false; |
| 1604 dump_as_markup_ = false; | 1613 dump_as_markup_ = false; |
| 1605 generate_pixel_results_ = true; | 1614 generate_pixel_results_ = true; |
| 1606 dump_child_frame_scroll_positions_ = false; | 1615 dump_child_frame_scroll_positions_ = false; |
| 1607 dump_child_frames_as_markup_ = false; | 1616 dump_child_frames_as_markup_ = false; |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2723 delegate_->SetDeviceScaleFactor(value); | 2732 delegate_->SetDeviceScaleFactor(value); |
| 2724 delegate_->PostTask(new InvokeCallbackTask(this, callback)); | 2733 delegate_->PostTask(new InvokeCallbackTask(this, callback)); |
| 2725 } | 2734 } |
| 2726 | 2735 |
| 2727 void TestRunner::SetColorProfile(const std::string& name, | 2736 void TestRunner::SetColorProfile(const std::string& name, |
| 2728 v8::Handle<v8::Function> callback) { | 2737 v8::Handle<v8::Function> callback) { |
| 2729 delegate_->SetDeviceColorProfile(name); | 2738 delegate_->SetDeviceColorProfile(name); |
| 2730 delegate_->PostTask(new InvokeCallbackTask(this, callback)); | 2739 delegate_->PostTask(new InvokeCallbackTask(this, callback)); |
| 2731 } | 2740 } |
| 2732 | 2741 |
| 2742 void TestRunner::SetBluetoothMockDataSet(const std::string& name) { |
| 2743 delegate_->SetBluetoothMockDataSet(name); |
| 2744 } |
| 2745 |
| 2733 void TestRunner::SetPOSIXLocale(const std::string& locale) { | 2746 void TestRunner::SetPOSIXLocale(const std::string& locale) { |
| 2734 delegate_->SetLocale(locale); | 2747 delegate_->SetLocale(locale); |
| 2735 } | 2748 } |
| 2736 | 2749 |
| 2737 void TestRunner::SetMIDIAccessorResult(bool result) { | 2750 void TestRunner::SetMIDIAccessorResult(bool result) { |
| 2738 midi_accessor_result_ = result; | 2751 midi_accessor_result_ = result; |
| 2739 } | 2752 } |
| 2740 | 2753 |
| 2741 void TestRunner::SetMIDISysexPermission(bool value) { | 2754 void TestRunner::SetMIDISysexPermission(bool value) { |
| 2742 for (auto* window : test_interfaces_->GetWindowList()) | 2755 for (auto* window : test_interfaces_->GetWindowList()) |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2948 } | 2961 } |
| 2949 | 2962 |
| 2950 void TestRunner::DidLosePointerLockInternal() { | 2963 void TestRunner::DidLosePointerLockInternal() { |
| 2951 bool was_locked = pointer_locked_; | 2964 bool was_locked = pointer_locked_; |
| 2952 pointer_locked_ = false; | 2965 pointer_locked_ = false; |
| 2953 if (was_locked) | 2966 if (was_locked) |
| 2954 web_view_->didLosePointerLock(); | 2967 web_view_->didLosePointerLock(); |
| 2955 } | 2968 } |
| 2956 | 2969 |
| 2957 } // namespace content | 2970 } // namespace content |
| OLD | NEW |