@@ -24,6 +24,15 @@ Manifest.prototype = {
2424 document . getElementById ( "over" ) . style . display = "none" ;
2525 document . getElementById ( "layout" ) . style . display = "none" ;
2626 document . getElementById ( "container" ) . style . display = "block" ;
27+ var popup_text = navigator . userAgent ;
28+ if ( popup_text . indexOf ( "Android" ) != - 1 && popup_text . indexOf ( "Crosswalk" ) == - 1 ) {
29+ var cookie_item = get_popup_cookie ( "wts_client" ) ;
30+ if ( cookie_item == "" ) {
31+ set_popup_cookie ( "wts_client" , "yes" , 30 ) ;
32+ document . getElementById ( "popup" ) . style . display = "block" ;
33+ document . getElementById ( "test_select_div" ) . classList . add ( "margin_top_50" ) ;
34+ }
35+ }
2736 this . data = JSON . parse ( xhr . responseText ) ;
2837 loaded_callback ( ) ;
2938 } . bind ( this ) ;
@@ -720,7 +729,21 @@ function TestControl(elem, runner) {
720729 this . advanced_link = this . elem . querySelector ( ".advanced_link" ) ;
721730 this . advanced_div = this . elem . querySelector ( ".advanced_div" ) ;
722731 this . start_error = this . elem . querySelector ( ".start_error" ) ;
723- this . set_start ( ) ;
732+ this . cancel_link = this . elem . querySelector ( "span.cancel_popup" ) ;
733+ this . spec_link = this . elem . querySelector ( "span.link_popup" ) ;
734+ this . popup_div = this . elem . querySelector ( "div.popup" ) ;
735+ this . test_select_div = this . elem . querySelector ( "div#test_select_div" ) ;
736+
737+ this . set_start ( ) ;
738+
739+ this . cancel_link . onclick = function ( ) {
740+ this . popup_div . style . display = "none" ;
741+ this . test_select_div . classList . remove ( "margin_top_50" ) ;
742+ } . bind ( this ) ;
743+
744+ this . spec_link . onclick = function ( ) {
745+ window . location . href = "https://github.com/crosswalk-project/web-testing-service/wiki#download" ;
746+ } . bind ( this ) ;
724747
725748 this . select_tab . onclick = function ( ) {
726749 this . select_select_tab ( ) ;
@@ -803,6 +826,8 @@ TestControl.prototype = {
803826 this . start_li . classList . remove ( "width_100" ) ;
804827 this . start_li . classList . add ( "width_49_75" ) ;
805828 this . pause_button . classList . remove ( "button_hidden" ) ;
829+ this . popup_div . style . display = "none" ;
830+ this . test_select_div . classList . remove ( "margin_top_50" ) ;
806831 window . scrollTo ( 0 , 0 ) ;
807832 var run_mode = "window" ;
808833 if ( this . iframe_checkbox . checked ) {
@@ -1348,6 +1373,26 @@ Runner.prototype = {
13481373
13491374} ;
13501375
1376+ function set_popup_cookie ( cookie_name , cookie_value , cookie_exdays ) {
1377+ var d = new Date ( ) ;
1378+ d . setTime ( d . getTime ( ) + ( cookie_exdays * 24 * 60 * 60 * 1000 ) ) ;
1379+ var expires = "expires=" + d . toUTCString ( ) ;
1380+ document . cookie = cookie_name + "=" + cookie_value + "; " + expires ;
1381+ }
1382+
1383+ function get_popup_cookie ( cname ) {
1384+ var name = cname + "=" ;
1385+ var ca = document . cookie . split ( ';' ) ;
1386+ for ( var i = 0 ; i < ca . length ; i ++ ) {
1387+ var c = ca [ i ] ;
1388+ while ( c . charAt ( 0 ) == ' ' ) c = c . substring ( 1 ) ;
1389+ if ( c . indexOf ( name ) == 0 ) {
1390+ return c . substring ( name . length , c . length ) ;
1391+ }
1392+ }
1393+ return "" ;
1394+ }
1395+
13511396function parseOptions ( ) {
13521397 var options = {
13531398 test_types : [ "testharness" , "reftest" , "manual" ]
0 commit comments