| OLD | NEW |
| 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 QUnit.module('error', { | 9 QUnit.module('error'); |
| 10 setup: function() { | |
| 11 }, | |
| 12 teardown: function() { | |
| 13 } | |
| 14 }); | |
| 15 | 10 |
| 16 QUnit.test('error constructor 1', function() { | 11 QUnit.test('error constructor 1', function() { |
| 17 var error = new remoting.Error(remoting.Error.Tag.HOST_OVERLOAD); | 12 var error = new remoting.Error(remoting.Error.Tag.HOST_OVERLOAD); |
| 18 QUnit.equal(error.getTag(), remoting.Error.Tag.HOST_OVERLOAD); | 13 QUnit.equal(error.getTag(), remoting.Error.Tag.HOST_OVERLOAD); |
| 19 QUnit.equal(error.toString(), remoting.Error.Tag.HOST_OVERLOAD); | 14 QUnit.equal(error.toString(), remoting.Error.Tag.HOST_OVERLOAD); |
| 20 }); | 15 }); |
| 21 | 16 |
| 22 QUnit.test('error constructor 2', function() { | 17 QUnit.test('error constructor 2', function() { |
| 23 var error = new remoting.Error( | 18 var error = new remoting.Error( |
| 24 remoting.Error.Tag.HOST_IS_OFFLINE, | 19 remoting.Error.Tag.HOST_IS_OFFLINE, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 var reportedError; | 103 var reportedError; |
| 109 var onError = function(/** !remoting.Error */ arg) { | 104 var onError = function(/** !remoting.Error */ arg) { |
| 110 reportedError = arg; | 105 reportedError = arg; |
| 111 }; | 106 }; |
| 112 var origError = new remoting.Error(remoting.Error.Tag.HOST_IS_OFFLINE); | 107 var origError = new remoting.Error(remoting.Error.Tag.HOST_IS_OFFLINE); |
| 113 remoting.Error.handler(onError)(origError); | 108 remoting.Error.handler(onError)(origError); |
| 114 QUnit.equal(reportedError, origError); | 109 QUnit.equal(reportedError, origError); |
| 115 }); | 110 }); |
| 116 | 111 |
| 117 })(); | 112 })(); |
| OLD | NEW |