OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
| 7 /* globals TEST, EXPECT_EQ, ASSERT_EQ, chrometest */ |
| 8 |
7 'use strict'; | 9 'use strict'; |
8 | 10 |
9 | |
10 TEST('ExtensionTest', 'testGetAllExtensions', function() { | 11 TEST('ExtensionTest', 'testGetAllExtensions', function() { |
11 return chrometest.getAllExtensions().then(function(extensions) { | 12 return chrometest.getAllExtensions().then(function(extensions) { |
12 ASSERT_EQ(3, extensions.length, 'there should be three extensions'); | 13 ASSERT_EQ(3, extensions.length, 'there should be three extensions'); |
13 var expected = [ | 14 var expected = [ |
14 'Chrome Testing Extension', | 15 'Chrome Testing Extension', |
15 'Ping Test Extension', | 16 'Ping Test Extension', |
16 'TCP Interface', | 17 'TCP Interface', |
17 ]; | 18 ]; |
18 expected.sort(); | 19 expected.sort(); |
19 var actual = []; | 20 var actual = []; |
(...skipping 24 matching lines...) Expand all Loading... |
44 }).then(function(port) { | 45 }).then(function(port) { |
45 keptPort = port; | 46 keptPort = port; |
46 keptPort.postMessage({'name': 'ping', 'data': data}); | 47 keptPort.postMessage({'name': 'ping', 'data': data}); |
47 return port.wait(); | 48 return port.wait(); |
48 }).then(function(msg) { | 49 }).then(function(msg) { |
49 EXPECT_EQ('pong', msg.name, 'we should have gotten a pong'); | 50 EXPECT_EQ('pong', msg.name, 'we should have gotten a pong'); |
50 EXPECT_EQ(data, msg.data, 'we should get back what we sent'); | 51 EXPECT_EQ(data, msg.data, 'we should get back what we sent'); |
51 keptPort.disconnect(); | 52 keptPort.disconnect(); |
52 }); | 53 }); |
53 }); | 54 }); |
OLD | NEW |