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

Side by Side Diff: chrome_test/tests/user_agent_test.js

Issue 1415743013: Run jshint over all JavaScript files (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@repo_conf
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « chrome_test/tests/processes_test.js ('k') | package.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 });
OLDNEW
« no previous file with comments | « chrome_test/tests/processes_test.js ('k') | package.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698