File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed
test/sanity/issue4679-process-event-uncaughtException Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+ < title > 4679</ title >
6
+ </ head >
7
+ < body >
8
+ < h1 id ="result "> </ h1 >
9
+ </ body >
10
+ < script >
11
+ window . addEventListener ( 'load' , function ( ) {
12
+
13
+ process . on ( 'uncaughtException' , function ( error ) {
14
+ // NEVER HAPPENS in 0.13
15
+ // process.stdout.write("CAUGHT\n");
16
+ // process.exit(1);
17
+ document . getElementById ( 'result' ) . innerHTML = 'CAUGHT' ;
18
+ } ) ;
19
+
20
+ global . setImmediate ( function ( ) {
21
+ throw ( "from node" ) ;
22
+ } ) ;
23
+ } ) ;
24
+ </ script >
25
+ </ html >
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " 4679" ,
3
+ "main" : " index.html"
4
+ }
Original file line number Diff line number Diff line change
1
+ import os
2
+ import sys
3
+ import platform
4
+ sys .path .append (os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
5
+ from nw_util import *
6
+
7
+ from selenium import webdriver
8
+ from selenium .webdriver .chrome .options import Options
9
+ from selenium .webdriver .common .action_chains import ActionChains
10
+
11
+ if platform .system () == "Windows" :
12
+ print "Skipped for Windows platform"
13
+ sys .exit (0 )
14
+
15
+ chrome_options = Options ()
16
+ chrome_options .add_argument ("nwapp=" + os .path .dirname (os .path .abspath (__file__ )))
17
+
18
+ driver = webdriver .Chrome (executable_path = os .environ ["CHROMEDRIVER" ], chrome_options = chrome_options )
19
+ driver .implicitly_wait (2 )
20
+ try :
21
+ print driver .current_url
22
+ result = wait_for_element_id_content (driver , "result" , "CAUGHT" )
23
+ assert ("CAUGHT" in result )
24
+ print "Got output from index page"
25
+ finally :
26
+ driver .quit ()
27
+
You can’t perform that action at this time.
0 commit comments