| 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, EXPECT_TRUE */ |
| 8 |
| 7 'use strict'; | 9 'use strict'; |
| 8 | 10 |
| 9 TEST('UserAgentTest', 'testInTestMode', function() { | 11 TEST('UserAgentTest', 'testInTestMode', function() { |
| 10 var parts = navigator.userAgent.split(' '); | 12 var parts = navigator.userAgent.split(' '); |
| 11 ASSERT_EQ(2, parts.length, 'agent has 2 sections'); | 13 ASSERT_EQ(2, parts.length, 'agent has 2 sections'); |
| 12 EXPECT_EQ('ChromeTestAgent', parts[0].split('/')[0], | 14 EXPECT_EQ('ChromeTestAgent', parts[0].split('/')[0], |
| 13 'should have test agent string'); | 15 'should have test agent string'); |
| 14 EXPECT_EQ(32, parts[0].split('/')[1].length, | 16 EXPECT_EQ(32, parts[0].split('/')[1].length, |
| 15 'should be a 32 digit extension id'); | 17 'should be a 32 digit extension id'); |
| 16 EXPECT_EQ('Chrome', parts[1].split('/')[0], | 18 EXPECT_EQ('Chrome', parts[1].split('/')[0], |
| 17 'must have chrome agent string'); | 19 'must have chrome agent string'); |
| 18 EXPECT_TRUE(/^\d+$/.test(parts[1].split('/')[1]), | 20 EXPECT_TRUE(/^\d+$/.test(parts[1].split('/')[1]), |
| 19 'must have a version number (for hterm)'); | 21 'must have a version number (for hterm)'); |
| 20 }); | 22 }); |
| OLD | NEW |