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

Side by Side Diff: remoting/webapp/unittests/base_unittest.js

Issue 503063004: Hangouts Remote Desktop Part VI - Show confirm dialog before retrieving access code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 (function() { 5 (function() {
6 6
7 'use strict'; 7 'use strict';
8 8
9 module('base'); 9 module('base');
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 a: 'a', 68 a: 'a',
69 foo: 'foo', 69 foo: 'foo',
70 escapist: ':/?#[]@$&+,;=' 70 escapist: ':/?#[]@$&+,;='
71 }); 71 });
72 QUnit.equal( 72 QUnit.equal(
73 result, 73 result,
74 'http://www.chromium.org?a=a&foo=foo' + 74 'http://www.chromium.org?a=a&foo=foo' +
75 '&escapist=%3A%2F%3F%23%5B%5D%40%24%26%2B%2C%3B%3D'); 75 '&escapist=%3A%2F%3F%23%5B%5D%40%24%26%2B%2C%3B%3D');
76 }); 76 });
77 77
78 test('escapeHTML(str) should escape special characters', function() {
79 QUnit.equal(
80 base.escapeHTML('<script>alert("hello")</script>'),
81 '&lt;script&gt;alert("hello")&lt;/script&gt;');
82 });
83
78 QUnit.asyncTest('Promise.sleep(delay) should fulfill the promise after |delay|', 84 QUnit.asyncTest('Promise.sleep(delay) should fulfill the promise after |delay|',
79 function() { 85 function() {
80 var isCalled = false; 86 var isCalled = false;
81 var clock = this.clock; 87 var clock = this.clock;
82 88
83 base.Promise.sleep(100).then(function(){ 89 base.Promise.sleep(100).then(function(){
84 isCalled = true; 90 isCalled = true;
85 ok(true, 'Promise.sleep() is fulfilled after delay.'); 91 ok(true, 'Promise.sleep() is fulfilled after delay.');
86 QUnit.start(); 92 QUnit.start();
87 }); 93 });
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 232
227 source.addEventListener('foo', sink.listener); 233 source.addEventListener('foo', sink.listener);
228 source.raiseEvent('foo'); 234 source.raiseEvent('foo');
229 sinon.assert.calledOnce(sink.listener); 235 sinon.assert.calledOnce(sink.listener);
230 236
231 source.raiseEvent('foo'); 237 source.raiseEvent('foo');
232 sinon.assert.calledOnce(sink.listener); 238 sinon.assert.calledOnce(sink.listener);
233 }); 239 });
234 240
235 })(); 241 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698