File tree Expand file tree Collapse file tree
html/webappapis/user-prompts/cannot-show-simple-dialogs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ < html >
2+ < script src ="/resources/testharness.js "> </ script >
3+ < script src ="/resources/testharnessreport.js "> </ script >
4+
5+ < script >
6+ setup ( { single_test : true } ) ;
7+ function handleEvent ( e ) {
8+ assert_equals ( e . data , 'pass' ) ;
9+ done ( ) ;
10+ }
11+ function on_iframe_load ( ) {
12+ var frameWin = document . getElementById ( 'confirmFrame' ) . contentWindow ;
13+ frameWin . postMessage ( 'Confirm' , '*' ) ;
14+ }
15+ window . addEventListener ( 'message' , handleEvent ) ;
16+ </ script >
17+
18+ < body >
19+ < iframe id ='confirmFrame '
20+ src ='http://{{hosts[alt][www]}}:{{ports[http][0]}}/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/confirm.html '
21+ onload ='on_iframe_load() '> </ iframe >
22+ </ body >
23+
24+ </ html >
Original file line number Diff line number Diff line change 1+ < html >
2+ < script src ="/resources/testharness.js "> </ script >
3+ < script src ="/resources/testharnessreport.js "> </ script >
4+
5+ < script >
6+ setup ( { single_test : true } ) ;
7+ function handleEvent ( e ) {
8+ assert_equals ( e . data , 'pass' ) ;
9+ done ( ) ;
10+ }
11+ function on_iframe_load ( ) {
12+ var frameWin = document . getElementById ( 'promptFrame' ) . contentWindow ;
13+ frameWin . postMessage ( 'Prompt' , '*' ) ;
14+ }
15+ window . addEventListener ( 'message' , handleEvent ) ;
16+ </ script >
17+
18+ < body >
19+ < iframe id ='promptFrame '
20+ src ='http://{{hosts[alt][www]}}:{{ports[http][0]}}/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/prompt.html '
21+ onload ='on_iframe_load() '> </ iframe >
22+ </ body >
23+
24+ </ html >
Original file line number Diff line number Diff line change 1+ < script >
2+ function handleEvent ( e ) {
3+ var conf = window . confirm ( 'Confirm Dialog' ) ;
4+ if ( conf == false ) {
5+ window . parent . postMessage ( 'pass' , '*' ) ;
6+ } else {
7+ window . parent . postMessage ( 'fail' , '*' ) ;
8+ }
9+ }
10+ window . addEventListener ( 'message' , handleEvent ) ;
11+ </ script >
Original file line number Diff line number Diff line change 1+ < script >
2+ function handleEvent ( e ) {
3+ var conf = window . prompt ( 'Prompt Dialog' ) ;
4+ if ( conf == null ) {
5+ window . parent . postMessage ( 'pass' , '*' ) ;
6+ } else {
7+ window . parent . postMessage ( 'fail' , '*' ) ;
8+ }
9+ }
10+ window . addEventListener ( 'message' , handleEvent ) ;
11+ </ script >
You can’t perform that action at this time.
0 commit comments