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

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

Issue 529293003: Extract ResultCatcher from ExtensionApiTest. Use it in ShellApiTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 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 console.log('background loaded test test DEBUGYOZ');
James Cook 2014/09/03 18:08:41 do you still need this line?
Yoyo Zhou 2014/09/04 21:57:42 No.
6
5 var testIPLiteralResolution = function() { 7 var testIPLiteralResolution = function() {
6 var callback = function(resolveInfo) { 8 var callback = function(resolveInfo) {
7 chrome.test.assertEq(0, resolveInfo.resultCode); 9 chrome.test.assertEq(0, resolveInfo.resultCode);
8 chrome.test.assertEq("127.0.0.1", resolveInfo.address); 10 chrome.test.assertEq("127.0.0.1", resolveInfo.address);
9 chrome.test.succeed("IP literal resolved"); 11 chrome.test.succeed("IP literal resolved");
10 }; 12 };
11 chrome.dns.resolve("127.0.0.1", callback); 13 chrome.dns.resolve("127.0.0.1", callback);
12 }; 14 };
13 15
14 var testHostnameResolution = function() { 16 var testHostnameResolution = function() {
(...skipping 10 matching lines...) Expand all
25 // NET_ERROR(NAME_NOT_RESOLVED, -105) 27 // NET_ERROR(NAME_NOT_RESOLVED, -105)
26 chrome.test.assertEq(-105, resolveInfo.resultCode); 28 chrome.test.assertEq(-105, resolveInfo.resultCode);
27 chrome.test.succeed("hostname correctly failed to resolve"); 29 chrome.test.succeed("hostname correctly failed to resolve");
28 }; 30 };
29 chrome.dns.resolve("this.hostname.is.bogus", callback); 31 chrome.dns.resolve("this.hostname.is.bogus", callback);
30 }; 32 };
31 33
32 chrome.test.runTests([testIPLiteralResolution, 34 chrome.test.runTests([testIPLiteralResolution,
33 testHostnameResolution, 35 testHostnameResolution,
34 testNonexistentHostnameResolution]); 36 testNonexistentHostnameResolution]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698