File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
test/sanity/issue6339-child-process-execSync-crash Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ < html >
2
+ < head >
3
+ < title > issue6339-child-process-execSync</ title >
4
+ </ head >
5
+ < body >
6
+ < h1 id ='result '> </ h1 >
7
+ < script >
8
+ var child = require ( 'child_process' ) ;
9
+ const stdout = child . execSync ( 'node -v' ) ;
10
+ document . getElementById ( 'result' ) . innerHTML = stdout
11
+ </ script >
12
+ < button id ='btn ' onclick ="nw.Window.get().showDevTools(); "> Click Me </ button >
13
+ </ body >
14
+ </ html >
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " issue6339-child-process-execSync-crash" ,
3
+ "main" : " index.html"
4
+ }
Original file line number Diff line number Diff line change
1
+ import time
2
+ import os
3
+ import sys
4
+
5
+ sys .path .append (os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
6
+ from nw_util import *
7
+
8
+ from selenium import webdriver
9
+ from selenium .webdriver .chrome .options import Options
10
+
11
+ chrome_options = Options ()
12
+ chrome_options .add_argument ("nwapp=" + os .path .dirname (os .path .abspath (__file__ )))
13
+
14
+ driver = webdriver .Chrome (executable_path = os .environ ["CHROMEDRIVER" ], chrome_options = chrome_options )
15
+ try :
16
+ print driver .current_url
17
+ res = wait_for_element_id (driver , "result" )
18
+ print res
19
+ assert ("v" in res )
20
+ driver .find_element_by_id ("btn" ).click ()
21
+ print "waiting for crash"
22
+ time .sleep (3 )
23
+ result = wait_for_element_id (driver , "result" )
24
+ assert ("v" in result )
25
+ print "There is no crash"
26
+ finally :
27
+ driver .quit ()
28
+
You can’t perform that action at this time.
0 commit comments