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_F, ASSERT_EQ, ASSERT_TRUE, chrometest, DevEnvTest */ |
| 8 |
7 'use strict'; | 9 'use strict'; |
8 | 10 |
9 // Tests of the Google I/O 2014 tutorial at: | 11 // Tests of the Google I/O 2014 tutorial at: |
10 // https://developer.chrome.com/native-client/io2014 | 12 // https://developer.chrome.com/native-client/io2014 |
11 | 13 |
12 // Install the default packages. | 14 // Install the default packages. |
13 // This test must be run before any tests that use these packages. | 15 // This test must be run before any tests that use these packages. |
14 TEST_F(DevEnvTest, 'testDefaultPackageInstall', function() { | 16 TEST_F(DevEnvTest, 'testDefaultPackageInstall', function() { |
15 var self = this; | 17 var self = this; |
16 return Promise.resolve().then(function() { | 18 return Promise.resolve().then(function() { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return self.writeFile('/home/user/patch1', patch); | 72 return self.writeFile('/home/user/patch1', patch); |
71 }).then(function() { | 73 }).then(function() { |
72 return self.checkCommand('cd work/voronoi && git apply ~/patch1'); | 74 return self.checkCommand('cd work/voronoi && git apply ~/patch1'); |
73 }).then(function() { | 75 }).then(function() { |
74 return self.checkCommand('cd work/voronoi && make -j10'); | 76 return self.checkCommand('cd work/voronoi && make -j10'); |
75 }).then(function() { | 77 }).then(function() { |
76 return self.checkCommand( | 78 return self.checkCommand( |
77 'cd work/voronoi && git commit -am "fixed build error"'); | 79 'cd work/voronoi && git commit -am "fixed build error"'); |
78 }).then(function() { | 80 }).then(function() { |
79 var sysArch = self.params['SYS_ARCH']; | 81 var sysArch = self.params['SYS_ARCH']; |
| 82 var libDir; |
| 83 var suffix; |
80 if (sysArch === 'i686') { | 84 if (sysArch === 'i686') { |
81 var libDir = 'lib32'; | 85 libDir = 'lib32'; |
82 var suffix = 'x86_32'; | 86 suffix = 'x86_32'; |
83 } else if (sysArch === 'x86_64') { | 87 } else if (sysArch === 'x86_64') { |
84 var libDir = 'lib64'; | 88 libDir = 'lib64'; |
85 var suffix = 'x86_64'; | 89 suffix = 'x86_64'; |
86 } else { | 90 } else { |
87 ASSERT_TRUE(false, 'unknown arch: ' + sysArch); | 91 ASSERT_TRUE(false, 'unknown arch: ' + sysArch); |
88 } | 92 } |
89 return self.spawnCommand( | 93 return self.spawnCommand( |
90 'cd work/voronoi && ' + | 94 'cd work/voronoi && ' + |
91 'LD_LIBRARY_PATH=' + libDir + ' ' + | 95 'LD_LIBRARY_PATH=' + libDir + ' ' + |
92 'NACL_SPAWN_MODE=popup ' + | 96 'NACL_SPAWN_MODE=popup ' + |
93 'NACL_POPUP_WIDTH=512 ' + | 97 'NACL_POPUP_WIDTH=512 ' + |
94 'NACL_POPUP_HEIGHT=512 ' + | 98 'NACL_POPUP_HEIGHT=512 ' + |
95 './voronoi_' + suffix + '.nexe'); | 99 './voronoi_' + suffix + '.nexe'); |
96 }).then(function(msg) { | 100 }).then(function(msg) { |
97 pid = msg.pid; | 101 pid = msg.pid; |
98 return chrometest.sleep(1000); | 102 return chrometest.sleep(1000); |
99 }).then(function(msg) { | 103 }).then(function(msg) { |
100 self.sigint(); | 104 self.sigint(); |
101 return self.waitCommand(pid); | 105 return self.waitCommand(pid); |
102 }).then(function(msg) { | 106 }).then(function(msg) { |
103 ASSERT_EQ(128 + 9, msg.status, 'Expect kill status'); | 107 ASSERT_EQ(128 + 9, msg.status, 'Expect kill status'); |
104 }); | 108 }); |
105 }); | 109 }); |
OLD | NEW |