From bfba6fcb46936d0c53f751e80ca267cb8481fa66 Mon Sep 17 00:00:00 2001 From: "kihong.kwon@samsung.com" Date: Mon, 25 Feb 2013 02:02:13 +0000 Subject: [PATCH] Add an ASSERT to didChangeDeviceProximity https://bugs.webkit.org/show_bug.cgi?id=110317 Reviewed by Hajime Morrita. Source/WebCore: Add An ASSERT to didChangeDeviceProximity function to check range of value. Change exist test cases. * Modules/proximity/DeviceProximityController.cpp: (WebCore::DeviceProximityController::didChangeDeviceProximity): LayoutTests: Fix wrong test cases which are found by ASSERT insertion. * proximity/basic-operation-expected.txt: * proximity/basic-operation.html: * proximity/resources/event-after-navigation-new.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143882 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 13 +++++++++++++ LayoutTests/proximity/basic-operation-expected.txt | 4 ++-- LayoutTests/proximity/basic-operation.html | 6 +++--- .../resources/event-after-navigation-new.html | 2 +- Source/WebCore/ChangeLog | 14 ++++++++++++++ .../proximity/DeviceProximityController.cpp | 2 ++ 6 files changed, 35 insertions(+), 6 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index bed0ee18357..8fbc57cf2c8 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,16 @@ +2013-02-24 Kihong Kwon + + Add an ASSERT to didChangeDeviceProximity + https://bugs.webkit.org/show_bug.cgi?id=110317 + + Reviewed by Hajime Morrita. + + Fix wrong test cases which are found by ASSERT insertion. + + * proximity/basic-operation-expected.txt: + * proximity/basic-operation.html: + * proximity/resources/event-after-navigation-new.html: + 2013-02-24 Mike West CSP 1.1: Experiment with 'reflected-xss' directive. diff --git a/LayoutTests/proximity/basic-operation-expected.txt b/LayoutTests/proximity/basic-operation-expected.txt index d9661a33eb6..00d7e7bbb32 100644 --- a/LayoutTests/proximity/basic-operation-expected.txt +++ b/LayoutTests/proximity/basic-operation-expected.txt @@ -4,8 +4,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE PASS deviceProximityEvent.value is firedEvent.value -PASS deviceProximityEvent.min is firedEvent.max -PASS deviceProximityEvent.max is firedEvent.min +PASS deviceProximityEvent.min is firedEvent.min +PASS deviceProximityEvent.max is firedEvent.max PASS successfullyParsed is true TEST COMPLETE diff --git a/LayoutTests/proximity/basic-operation.html b/LayoutTests/proximity/basic-operation.html index ec1ef4ded2b..e6736332fe3 100644 --- a/LayoutTests/proximity/basic-operation.html +++ b/LayoutTests/proximity/basic-operation.html @@ -12,12 +12,12 @@ var deviceProximityEvent; window.addEventListener('webkitdeviceproximity', function(e) { deviceProximityEvent = e; shouldBe('deviceProximityEvent.value', 'firedEvent.value'); - shouldBe('deviceProximityEvent.min', 'firedEvent.max'); - shouldBe('deviceProximityEvent.max', 'firedEvent.min'); + shouldBe('deviceProximityEvent.min', 'firedEvent.min'); + shouldBe('deviceProximityEvent.max', 'firedEvent.max'); finishJSTest(); }); -internals.setDeviceProximity(document, 'webkitdeviceproximity', firedEvent.value, firedEvent.max, firedEvent.min); +internals.setDeviceProximity(document, 'webkitdeviceproximity', firedEvent.value, firedEvent.min, firedEvent.max); window.jsTestIsAsync = true; diff --git a/LayoutTests/proximity/resources/event-after-navigation-new.html b/LayoutTests/proximity/resources/event-after-navigation-new.html index 06644cef304..8b0401448ca 100644 --- a/LayoutTests/proximity/resources/event-after-navigation-new.html +++ b/LayoutTests/proximity/resources/event-after-navigation-new.html @@ -7,7 +7,7 @@ SUCCESS diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 26f66d212e4..872052e82c1 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,17 @@ +2013-02-24 Kihong Kwon + + Add an ASSERT to didChangeDeviceProximity + https://bugs.webkit.org/show_bug.cgi?id=110317 + + Reviewed by Hajime Morrita. + + Add An ASSERT to didChangeDeviceProximity function to check range of value. + + Change exist test cases. + + * Modules/proximity/DeviceProximityController.cpp: + (WebCore::DeviceProximityController::didChangeDeviceProximity): + 2013-02-24 Alexey Proskuryakov Clarify meaning of default default encoding localizable string diff --git a/Source/WebCore/Modules/proximity/DeviceProximityController.cpp b/Source/WebCore/Modules/proximity/DeviceProximityController.cpp index 5ef18179b4b..a64d47ac613 100644 --- a/Source/WebCore/Modules/proximity/DeviceProximityController.cpp +++ b/Source/WebCore/Modules/proximity/DeviceProximityController.cpp @@ -47,6 +47,8 @@ PassOwnPtr DeviceProximityController::create(DevicePr void DeviceProximityController::didChangeDeviceProximity(const double value, const double min, const double max) { + ASSERT(value >= min && value <= max); + dispatchDeviceEvent(DeviceProximityEvent::create(eventNames().webkitdeviceproximityEvent, value, min, max)); } -- GitLab