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

Side by Side Diff: chrome/test/data/extensions/api_test/dns/api/background.js

Issue 23867002: Move dns API to dev channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding missing dns.idl file Created 7 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 var testIPLiteralResolution = function() { 5 var testIPLiteralResolution = function() {
6 var callback = function(resolveInfo) { 6 var callback = function(resolveInfo) {
7 chrome.test.assertEq(0, resolveInfo.resultCode); 7 chrome.test.assertEq(0, resolveInfo.resultCode);
8 chrome.test.assertEq("127.0.0.1", resolveInfo.address); 8 chrome.test.assertEq("127.0.0.1", resolveInfo.address);
9 chrome.test.succeed("IP literal resolved"); 9 chrome.test.succeed("IP literal resolved");
10 }; 10 };
11 chrome.experimental.dns.resolve("127.0.0.1", callback); 11 chrome.dns.resolve("127.0.0.1", callback);
12 }; 12 };
13 13
14 var testHostnameResolution = function() { 14 var testHostnameResolution = function() {
15 var callback = function(resolveInfo) { 15 var callback = function(resolveInfo) {
16 chrome.test.assertEq(0, resolveInfo.resultCode); 16 chrome.test.assertEq(0, resolveInfo.resultCode);
17 chrome.test.assertEq("9.8.7.6", resolveInfo.address); 17 chrome.test.assertEq("9.8.7.6", resolveInfo.address);
18 chrome.test.succeed("hostname resolved"); 18 chrome.test.succeed("hostname resolved");
19 }; 19 };
20 chrome.experimental.dns.resolve("www.sowbug.com", callback); 20 chrome.dns.resolve("www.sowbug.com", callback);
21 }; 21 };
22 22
23 var testNonexistentHostnameResolution = function() { 23 var testNonexistentHostnameResolution = function() {
24 var callback = function(resolveInfo) { 24 var callback = function(resolveInfo) {
25 // NET_ERROR(NAME_NOT_RESOLVED, -105) 25 // NET_ERROR(NAME_NOT_RESOLVED, -105)
26 chrome.test.assertEq(-105, resolveInfo.resultCode); 26 chrome.test.assertEq(-105, resolveInfo.resultCode);
27 chrome.test.succeed("hostname correctly failed to resolve"); 27 chrome.test.succeed("hostname correctly failed to resolve");
28 }; 28 };
29 chrome.experimental.dns.resolve("this.hostname.is.bogus", callback); 29 chrome.dns.resolve("this.hostname.is.bogus", callback);
30 }; 30 };
31 31
32 chrome.test.runTests([testIPLiteralResolution, 32 chrome.test.runTests([testIPLiteralResolution,
33 testHostnameResolution, 33 testHostnameResolution,
34 testNonexistentHostnameResolution]); 34 testNonexistentHostnameResolution]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698