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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/error.html

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/Geolocation/error.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error.html
index f7f63ea753637bd5e990f0e187e0742d23c9d8ec..d7486231fc1d84939d95af60de830fabd8f2b041 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error.html
@@ -4,8 +4,35 @@
<script src="../../../resources/js-test.js"></script>
<script src="../../../resources/mojo-helpers.js"></script>
<script src="resources/geolocation-mock.js"></script>
-<script src="script-tests/error.js"></script>
</head>
<body>
+<script>
+description("Tests Geolocation error callback using the mock service.");
+
+var mockMessage = "debug";
+
+var error;
+
+geolocationServiceMock.then(mock => {
+ mock.setGeolocationPermission(true);
+ mock.setGeolocationPositionUnavailableError(mockMessage);
+
+ navigator.geolocation.getCurrentPosition(function(p) {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ error = e;
+ shouldBe('error.code', 'error.POSITION_UNAVAILABLE');
+ shouldBe('error.message', 'mockMessage');
+ shouldBe('error.UNKNOWN_ERROR', 'undefined');
+ shouldBe('error.PERMISSION_DENIED', '1');
+ shouldBe('error.POSITION_UNAVAILABLE', '2');
+ shouldBe('error.TIMEOUT', '3');
+ finishJSTest();
+ });
+});
+
+window.jsTestIsAsync = true;
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698