[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 15:59:08 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 74d5a6dd72d8b76906ce8347c023a07c98071386
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 17 17:08:31 2010 +0000

    2010-11-17  John Knottenbelt  <jknotten at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            Add a layout test to check that Geoposition timestamps are
            well-formed. See https://bugs.webkit.org/show_bug.cgi?id=48518
    
            * fast/dom/Geolocation/script-tests/timestamp.js: Added.
            (checkPosition):
            * fast/dom/Geolocation/timestamp-expected.txt: Added.
            * fast/dom/Geolocation/timestamp.html: Added.
    2010-11-17  John Knottenbelt  <jknotten at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            Convert correctly between GeolocationPosition and Geoposition
            timestamp formats.
            https://bugs.webkit.org/show_bug.cgi?id=48518
    
            Test: fast/dom/Geolocation/timestamp.html
    
            * page/Geolocation.cpp:
            (WebCore::createGeoposition):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index fa1ba1a..44cbcbd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-17  John Knottenbelt  <jknotten at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Add a layout test to check that Geoposition timestamps are
+        well-formed. See https://bugs.webkit.org/show_bug.cgi?id=48518
+
+        * fast/dom/Geolocation/script-tests/timestamp.js: Added.
+        (checkPosition):
+        * fast/dom/Geolocation/timestamp-expected.txt: Added.
+        * fast/dom/Geolocation/timestamp.html: Added.
+
 2010-11-17  Chang Shu  <chang.shu at nokia.com>
 
         Reviewed by Antonio Gomes.
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/timestamp.js b/LayoutTests/fast/dom/Geolocation/script-tests/timestamp.js
new file mode 100644
index 0000000..b51ca43
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/timestamp.js
@@ -0,0 +1,34 @@
+description("Tests that Geoposition timestamps are well-formed (non-zero and in the same units as Date.getTime).");
+
+var mockLatitude = 51.478;
+var mockLongitude = -0.166;
+var mockAccuracy = 100.0;
+
+if (window.layoutTestController) {
+    layoutTestController.setGeolocationPermission(true);
+    layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
+}
+
+var now = new Date().getTime();
+shouldBeTrue('now != 0');
+var t = null;
+var then = null;
+
+function checkPosition(p) {
+    t = p.timestamp;
+    var d = new Date();
+    then = d.getTime();
+    shouldBeTrue('t != 0');
+    shouldBeTrue('then != 0');
+    shouldBeTrue('now - 1 <= t'); // Avoid rounding errors
+    if (now - 1 > t) {
+        debug("  now - 1 = " + (now-1));
+        debug("  t = " + t);
+    }
+    shouldBeTrue('t <= then + 1'); // Avoid rounding errors
+    finishJSTest();
+}
+
+navigator.geolocation.getCurrentPosition(checkPosition);
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/timestamp-expected.txt b/LayoutTests/fast/dom/Geolocation/timestamp-expected.txt
new file mode 100644
index 0000000..e4e8c91
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/timestamp-expected.txt
@@ -0,0 +1,14 @@
+Tests that Geoposition timestamps are well-formed (non-zero and in the same units as Date.getTime).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS now != 0 is true
+PASS t != 0 is true
+PASS then != 0 is true
+PASS now - 1 <= t is true
+PASS t <= then + 1 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/timestamp.html b/LayoutTests/fast/dom/Geolocation/timestamp.html
new file mode 100644
index 0000000..ce319a7
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/timestamp.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/timestamp.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b57c5c8..3a6c0b3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-17  John Knottenbelt  <jknotten at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Convert correctly between GeolocationPosition and Geoposition
+        timestamp formats.
+        https://bugs.webkit.org/show_bug.cgi?id=48518
+
+        Test: fast/dom/Geolocation/timestamp.html
+
+        * page/Geolocation.cpp:
+        (WebCore::createGeoposition):
+
 2010-11-17  Chang Shu  <chang.shu at nokia.com>
 
         Reviewed by Antonio Gomes.
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index bed8fb4..2a2b522 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -61,7 +61,7 @@ static PassRefPtr<Geoposition> createGeoposition(GeolocationPosition* position)
     RefPtr<Coordinates> coordinates = Coordinates::create(position->latitude(), position->longitude(), position->canProvideAltitude(), position->altitude(), 
                                                           position->accuracy(), position->canProvideAltitudeAccuracy(), position->altitudeAccuracy(),
                                                           position->canProvideHeading(), position->heading(), position->canProvideSpeed(), position->speed());
-    return Geoposition::create(coordinates.release(), position->timestamp());
+    return Geoposition::create(coordinates.release(), convertSecondsToDOMTimeStamp(position->timestamp()));
 }
 
 static PassRefPtr<PositionError> createPositionError(GeolocationError* error)
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/CurrentTime.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/CurrentTime.h
similarity index 100%
copy from JavaScriptGlue/ForwardingHeaders/wtf/CurrentTime.h
copy to WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/CurrentTime.h
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index 0191084..b19d6b5 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -70,6 +70,7 @@
 #import <WebKit/WebView.h>
 #import <WebKit/WebViewPrivate.h>
 #import <WebKit/WebWorkersPrivate.h>
+#import <wtf/CurrentTime.h>
 #import <wtf/HashMap.h>
 #import <wtf/RetainPtr.h>
 
@@ -353,7 +354,7 @@ void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double
 
 void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
 {
-    WebGeolocationPosition *position = [[WebGeolocationPosition alloc] initWithTimestamp:0 latitude:latitude longitude:longitude accuracy:accuracy];
+    WebGeolocationPosition *position = [[WebGeolocationPosition alloc] initWithTimestamp:currentTime() latitude:latitude longitude:longitude accuracy:accuracy];
     [[MockGeolocationProvider shared] setPosition:position];
     [position release];
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list