OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var util = {}; | 5 var util = {}; |
6 var embedder = {}; | 6 var embedder = {}; |
7 embedder.baseGuestURL = ''; | 7 embedder.baseGuestURL = ''; |
8 embedder.emptyGuestURL = ''; | 8 embedder.emptyGuestURL = ''; |
9 embedder.windowOpenGuestURL = ''; | 9 embedder.windowOpenGuestURL = ''; |
10 embedder.noReferrerGuestURL = ''; | 10 embedder.noReferrerGuestURL = ''; |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 | 757 |
758 webview.setAttribute('src', 'data:text/html,<html><body>guest</body></html>'); | 758 webview.setAttribute('src', 'data:text/html,<html><body>guest</body></html>'); |
759 } | 759 } |
760 | 760 |
761 // This test verifies that a content script will be injected to the webview when | 761 // This test verifies that a content script will be injected to the webview when |
762 // the webview is navigated to a page that matches the URL pattern defined in | 762 // the webview is navigated to a page that matches the URL pattern defined in |
763 // the content sript. | 763 // the content sript. |
764 function testAddContentScript() { | 764 function testAddContentScript() { |
765 var webview = document.createElement('webview'); | 765 var webview = document.createElement('webview'); |
766 | 766 |
767 console.log("Step 1: call <webview>.addContentScripts."); | 767 console.log('Step 1: call <webview>.addContentScripts.'); |
768 webview.addContentScripts( | 768 webview.addContentScripts( |
769 [{"name": 'myrule', | 769 [{"name": 'myrule', |
770 "matches": ["http://*/extensions/*"], | 770 "matches": ['http://*/extensions/*'], |
771 "js": ["inject_comm_channel.js"], | 771 "js": ['inject_comm_channel.js'], |
772 "run_at": "document_start"}]); | 772 "run_at": 'document_start'}]); |
773 | 773 |
774 webview.addEventListener('loadstop', function() { | 774 webview.addEventListener('loadstop', function() { |
775 var msg = [request_to_comm_channel_1]; | 775 var msg = [request_to_comm_channel_1]; |
776 webview.contentWindow.postMessage(JSON.stringify(msg), '*'); | 776 webview.contentWindow.postMessage(JSON.stringify(msg), '*'); |
777 }); | 777 }); |
778 | 778 |
779 window.addEventListener('message', function(e) { | 779 window.addEventListener('message', function(e) { |
780 var data = JSON.parse(e.data); | 780 var data = JSON.parse(e.data); |
781 if (data == response_from_comm_channel_1) { | 781 if (data == response_from_comm_channel_1) { |
782 console.log( | 782 console.log( |
783 'Step 2: A communication channel has been established with webview.'); | 783 'Step 2: A communication channel has been established with webview.'); |
784 embedder.test.succeed(); | 784 embedder.test.succeed(); |
785 return; | 785 return; |
786 } | 786 } |
787 console.log('Unexpected message: \'' + data[0] + '\''); | 787 console.log('Unexpected message: \'' + data[0] + '\''); |
788 embedder.test.fail(); | 788 embedder.test.fail(); |
789 }); | 789 }); |
790 | 790 |
791 webview.src = embedder.emptyGuestURL; | 791 webview.src = embedder.emptyGuestURL; |
792 document.body.appendChild(webview); | 792 document.body.appendChild(webview); |
793 } | 793 } |
794 | 794 |
795 // Adds two content scripts with the same URL pattern to <webview> at the same | 795 // Adds two content scripts with the same URL pattern to <webview> at the same |
796 // time. This test verifies that both scripts are injected when the <webview> | 796 // time. This test verifies that both scripts are injected when the <webview> |
797 // navigates to a URL that matches the URL pattern. | 797 // navigates to a URL that matches the URL pattern. |
798 function testAddMultipleContentScripts() { | 798 function testAddMultipleContentScripts() { |
799 var webview = document.createElement('webview'); | 799 var webview = document.createElement('webview'); |
800 | 800 |
801 console.log("Step 1: call <webview>.addContentScripts(myrule1 & myrule2)"); | 801 console.log('Step 1: call <webview>.addContentScripts(myrule1 & myrule2)'); |
802 webview.addContentScripts( | 802 webview.addContentScripts( |
803 [{"name": 'myrule1', | 803 [{"name": 'myrule1', |
804 "matches": ["http://*/extensions/*"], | 804 "matches": ['http://*/extensions/*'], |
805 "js": ["inject_comm_channel.js"], | 805 "js": ['inject_comm_channel.js'], |
806 "run_at": "document_start"}, | 806 "run_at": 'document_start'}, |
807 {"name": 'myrule2', | 807 {"name": 'myrule2', |
808 "matches": ["http://*/extensions/*"], | 808 "matches": ['http://*/extensions/*'], |
809 "js": ["inject_comm_channel_2.js"], | 809 "js": ['inject_comm_channel_2.js'], |
810 "run_at": "document_start"}]); | 810 "run_at": 'document_start'}]); |
811 | 811 |
812 webview.addEventListener('loadstop', function() { | 812 webview.addEventListener('loadstop', function() { |
813 var msg1 = [request_to_comm_channel_1]; | 813 var msg1 = [request_to_comm_channel_1]; |
814 webview.contentWindow.postMessage(JSON.stringify(msg1), '*'); | 814 webview.contentWindow.postMessage(JSON.stringify(msg1), '*'); |
815 var msg2 = [request_to_comm_channel_2]; | 815 var msg2 = [request_to_comm_channel_2]; |
816 webview.contentWindow.postMessage(JSON.stringify(msg2), '*'); | 816 webview.contentWindow.postMessage(JSON.stringify(msg2), '*'); |
817 }); | 817 }); |
818 | 818 |
819 var response_1 = false; | 819 var response_1 = false; |
820 var response_2 = false; | 820 var response_2 = false; |
(...skipping 23 matching lines...) Expand all Loading... |
844 } | 844 } |
845 | 845 |
846 // Adds a content script to <webview> and navigates. After seeing the script is | 846 // Adds a content script to <webview> and navigates. After seeing the script is |
847 // injected, we add another content script with the same name to the <webview>. | 847 // injected, we add another content script with the same name to the <webview>. |
848 // This test verifies that the second script will replace the first one and be | 848 // This test verifies that the second script will replace the first one and be |
849 // injected after navigating the <webview>. Meanwhile, the <webview> shouldn't | 849 // injected after navigating the <webview>. Meanwhile, the <webview> shouldn't |
850 // get any message from the first script anymore. | 850 // get any message from the first script anymore. |
851 function testAddContentScriptWithSameNameShouldOverwriteTheExistingOne() { | 851 function testAddContentScriptWithSameNameShouldOverwriteTheExistingOne() { |
852 var webview = document.createElement('webview'); | 852 var webview = document.createElement('webview'); |
853 | 853 |
854 console.log("Step 1: call <webview>.addContentScripts(myrule1)"); | 854 console.log('Step 1: call <webview>.addContentScripts(myrule1)'); |
855 webview.addContentScripts( | 855 webview.addContentScripts( |
856 [{"name": 'myrule1', | 856 [{"name": 'myrule1', |
857 "matches": ["http://*/extensions/*"], | 857 "matches": ['http://*/extensions/*'], |
858 "js": ["inject_comm_channel.js"], | 858 "js": ['inject_comm_channel.js'], |
859 "run_at": "document_start"}]); | 859 "run_at": 'document_start'}]); |
860 var connect_script_1 = true; | 860 var connect_script_1 = true; |
861 var connect_script_2 = false; | 861 var connect_script_2 = false; |
862 | 862 |
863 webview.addEventListener('loadstop', function() { | 863 webview.addEventListener('loadstop', function() { |
864 if (connect_script_1) { | 864 if (connect_script_1) { |
865 var msg1 = [request_to_comm_channel_1]; | 865 var msg1 = [request_to_comm_channel_1]; |
866 webview.contentWindow.postMessage(JSON.stringify(msg1), '*'); | 866 webview.contentWindow.postMessage(JSON.stringify(msg1), '*'); |
867 connect_script_1 = false; | 867 connect_script_1 = false; |
868 } | 868 } |
869 if (connect_script_2) { | 869 if (connect_script_2) { |
870 var msg2 = [request_to_comm_channel_2]; | 870 var msg2 = [request_to_comm_channel_2]; |
871 webview.contentWindow.postMessage(JSON.stringify(msg2), '*'); | 871 webview.contentWindow.postMessage(JSON.stringify(msg2), '*'); |
872 connect_script_2 = false; | 872 connect_script_2 = false; |
873 } | 873 } |
874 }); | 874 }); |
875 | 875 |
876 var should_get_response_from_script_1 = true; | 876 var should_get_response_from_script_1 = true; |
877 window.addEventListener('message', function(e) { | 877 window.addEventListener('message', function(e) { |
878 var data = JSON.parse(e.data); | 878 var data = JSON.parse(e.data); |
879 if (data == response_from_comm_channel_1) { | 879 if (data == response_from_comm_channel_1) { |
880 if (should_get_response_from_script_1) { | 880 if (should_get_response_from_script_1) { |
881 console.log( | 881 console.log( |
882 'Step 2: A communication channel has been established with webview.' | 882 'Step 2: A communication channel has been established with webview.' |
883 ); | 883 ); |
884 webview.addContentScripts( | 884 webview.addContentScripts( |
885 [{"name": 'myrule1', | 885 [{"name": 'myrule1', |
886 "matches": ["http://*/extensions/*"], | 886 "matches": ['http://*/extensions/*'], |
887 "js": ["inject_comm_channel_2.js"], | 887 "js": ['inject_comm_channel_2.js'], |
888 "run_at": "document_start"}]); | 888 "run_at": 'document_start'}]); |
889 connect_script_2 = true; | 889 connect_script_2 = true; |
890 should_get_response_from_script_1 = false; | 890 should_get_response_from_script_1 = false; |
891 webview.src = embedder.emptyGuestURL; | 891 webview.src = embedder.emptyGuestURL; |
892 } else { | 892 } else { |
893 embedder.test.fail(); | 893 embedder.test.fail(); |
894 } | 894 } |
895 return; | 895 return; |
896 } else if (data == response_from_comm_channel_2) { | 896 } else if (data == response_from_comm_channel_2) { |
897 console.log( | 897 console.log( |
898 'Step 3: Another communication channel has been established ' + | 898 'Step 3: Another communication channel has been established ' + |
(...skipping 11 matching lines...) Expand all Loading... |
910 document.body.appendChild(webview); | 910 document.body.appendChild(webview); |
911 } | 911 } |
912 | 912 |
913 // There are two <webview>s are added to the DOM, and we add a content script | 913 // There are two <webview>s are added to the DOM, and we add a content script |
914 // to one of them. This test verifies that the script won't be injected in | 914 // to one of them. This test verifies that the script won't be injected in |
915 // the other <webview>. | 915 // the other <webview>. |
916 function testAddContentScriptToOneWebViewShouldNotInjectToTheOtherWebView() { | 916 function testAddContentScriptToOneWebViewShouldNotInjectToTheOtherWebView() { |
917 var webview1 = document.createElement('webview'); | 917 var webview1 = document.createElement('webview'); |
918 var webview2 = document.createElement('webview'); | 918 var webview2 = document.createElement('webview'); |
919 | 919 |
920 console.log("Step 1: call <webview1>.addContentScripts."); | 920 console.log('Step 1: call <webview1>.addContentScripts.'); |
921 webview1.addContentScripts( | 921 webview1.addContentScripts( |
922 [{"name": 'myrule', | 922 [{"name": 'myrule', |
923 "matches": ["http://*/extensions/*"], | 923 "matches": ['http://*/extensions/*'], |
924 "js": ["inject_comm_channel.js"], | 924 "js": ['inject_comm_channel.js'], |
925 "run_at": "document_start"}]); | 925 "run_at": 'document_start'}]); |
926 | 926 |
927 webview2.addEventListener('loadstop', function() { | 927 webview2.addEventListener('loadstop', function() { |
928 console.log("Step 2: webview2 requests to build communication channel."); | 928 console.log('Step 2: webview2 requests to build communication channel.'); |
929 var msg = [request_to_comm_channel_1]; | 929 var msg = [request_to_comm_channel_1]; |
930 webview2.contentWindow.postMessage(JSON.stringify(msg), '*'); | 930 webview2.contentWindow.postMessage(JSON.stringify(msg), '*'); |
931 setTimeout(function() { | 931 setTimeout(function() { |
932 embedder.test.succeed(); | 932 embedder.test.succeed(); |
933 }, 0); | 933 }, 0); |
934 }); | 934 }); |
935 | 935 |
936 window.addEventListener('message', function(e) { | 936 window.addEventListener('message', function(e) { |
937 var data = JSON.parse(e.data); | 937 var data = JSON.parse(e.data); |
938 if (data == response_from_comm_channel_1) { | 938 if (data == response_from_comm_channel_1) { |
(...skipping 12 matching lines...) Expand all Loading... |
951 | 951 |
952 | 952 |
953 // Adds a content script to <webview> and navigates to a URL that matches the | 953 // Adds a content script to <webview> and navigates to a URL that matches the |
954 // URL pattern defined in the script. After the first navigation, we remove this | 954 // URL pattern defined in the script. After the first navigation, we remove this |
955 // script from the <webview> and navigates to the same URL. This test verifies | 955 // script from the <webview> and navigates to the same URL. This test verifies |
956 // taht the script is injected during the first navigation, but isn't injected | 956 // taht the script is injected during the first navigation, but isn't injected |
957 // after removing it. | 957 // after removing it. |
958 function testAddAndRemoveContentScripts() { | 958 function testAddAndRemoveContentScripts() { |
959 var webview = document.createElement('webview'); | 959 var webview = document.createElement('webview'); |
960 | 960 |
961 console.log("Step 1: call <webview>.addContentScripts."); | 961 console.log('Step 1: call <webview>.addContentScripts.'); |
962 webview.addContentScripts( | 962 webview.addContentScripts( |
963 [{"name": 'myrule', | 963 [{"name": 'myrule', |
964 "matches": ["http://*/extensions/*"], | 964 "matches": ['http://*/extensions/*'], |
965 "js": ["inject_comm_channel.js"], | 965 "js": ['inject_comm_channel.js'], |
966 "run_at": "document_start"}]); | 966 "run_at": 'document_start'}]); |
967 | 967 |
968 var count = 0; | 968 var count = 0; |
969 webview.addEventListener('loadstop', function() { | 969 webview.addEventListener('loadstop', function() { |
970 if (count == 0) { | 970 if (count == 0) { |
971 console.log('Step 2: post message to build connect.'); | 971 console.log('Step 2: post message to build connect.'); |
972 var msg = [request_to_comm_channel_1]; | 972 var msg = [request_to_comm_channel_1]; |
973 webview.contentWindow.postMessage(JSON.stringify(msg), '*'); | 973 webview.contentWindow.postMessage(JSON.stringify(msg), '*'); |
974 ++count; | 974 ++count; |
975 } else if (count == 1) { | 975 } else if (count == 1) { |
976 console.log( | 976 console.log( |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 var webview = document.createElement('webview'); | 1017 var webview = document.createElement('webview'); |
1018 | 1018 |
1019 var newwebview; | 1019 var newwebview; |
1020 webview.addEventListener('newwindow', function(e) { | 1020 webview.addEventListener('newwindow', function(e) { |
1021 e.preventDefault(); | 1021 e.preventDefault(); |
1022 newwebview = document.createElement('webview'); | 1022 newwebview = document.createElement('webview'); |
1023 | 1023 |
1024 console.log('Step 2: call newwebview.addContentScripts.'); | 1024 console.log('Step 2: call newwebview.addContentScripts.'); |
1025 newwebview.addContentScripts( | 1025 newwebview.addContentScripts( |
1026 [{"name": 'myrule', | 1026 [{"name": 'myrule', |
1027 "matches": ["http://*/extensions/*"], | 1027 "matches": ['http://*/extensions/*'], |
1028 "js": ["inject_comm_channel.js"], | 1028 "js": ['inject_comm_channel.js'], |
1029 "run_at": "document_start"}]); | 1029 "run_at": 'document_start'}]); |
1030 | 1030 |
1031 newwebview.addEventListener('loadstop', function(evt) { | 1031 newwebview.addEventListener('loadstop', function(evt) { |
1032 var msg = [request_to_comm_channel_1]; | 1032 var msg = [request_to_comm_channel_1]; |
1033 console.log('Step 4: new webview postmessage to build communication ' + | 1033 console.log('Step 4: new webview postmessage to build communication ' + |
1034 'channel.'); | 1034 'channel.'); |
1035 newwebview.contentWindow.postMessage(JSON.stringify(msg), '*'); | 1035 newwebview.contentWindow.postMessage(JSON.stringify(msg), '*'); |
1036 }); | 1036 }); |
1037 | 1037 |
1038 document.body.appendChild(newwebview); | 1038 document.body.appendChild(newwebview); |
1039 // attach the new window to the new <webview>. | 1039 // attach the new window to the new <webview>. |
1040 console.log("Step 3: attaches the new webview."); | 1040 console.log('Step 3: attaches the new webview.'); |
1041 e.window.attach(newwebview); | 1041 e.window.attach(newwebview); |
1042 }); | 1042 }); |
1043 | 1043 |
1044 window.addEventListener('message', function(e) { | 1044 window.addEventListener('message', function(e) { |
1045 var data = JSON.parse(e.data); | 1045 var data = JSON.parse(e.data); |
1046 if (data == response_from_comm_channel_1 && | 1046 if (data == response_from_comm_channel_1 && |
1047 e.source == newwebview.contentWindow) { | 1047 e.source == newwebview.contentWindow) { |
1048 console.log('Step 5: a communication channel has been established ' + | 1048 console.log('Step 5: a communication channel has been established ' + |
1049 'with the new webview.'); | 1049 'with the new webview.'); |
1050 embedder.test.succeed(); | 1050 embedder.test.succeed(); |
(...skipping 12 matching lines...) Expand all Loading... |
1063 } | 1063 } |
1064 | 1064 |
1065 // Adds a content script to <webview>. This test verifies that the script is | 1065 // Adds a content script to <webview>. This test verifies that the script is |
1066 // injected after terminate and reload <webview>. | 1066 // injected after terminate and reload <webview>. |
1067 function testContentScriptIsInjectedAfterTerminateAndReloadWebView() { | 1067 function testContentScriptIsInjectedAfterTerminateAndReloadWebView() { |
1068 var webview = document.createElement('webview'); | 1068 var webview = document.createElement('webview'); |
1069 | 1069 |
1070 console.log('Step 1: call <webview>.addContentScripts.'); | 1070 console.log('Step 1: call <webview>.addContentScripts.'); |
1071 webview.addContentScripts( | 1071 webview.addContentScripts( |
1072 [{"name": 'myrule', | 1072 [{"name": 'myrule', |
1073 "matches": ["http://*/extensions/*"], | 1073 "matches": ['http://*/extensions/*'], |
1074 "js": ["inject_comm_channel.js"], | 1074 "js": ['inject_comm_channel.js'], |
1075 "run_at": "document_start"}]); | 1075 "run_at": 'document_start'}]); |
1076 | 1076 |
1077 var count = 0; | 1077 var count = 0; |
1078 webview.addEventListener('loadstop', function() { | 1078 webview.addEventListener('loadstop', function() { |
1079 if (count == 0) { | 1079 if (count == 0) { |
1080 console.log('Step 2: call webview.terminate().'); | 1080 console.log('Step 2: call webview.terminate().'); |
1081 webview.terminate(); | 1081 webview.terminate(); |
1082 ++count; | 1082 ++count; |
1083 return; | 1083 return; |
1084 } else if (count == 1) { | 1084 } else if (count == 1) { |
1085 console.log('Step 4: postMessage to build communication.'); | 1085 console.log('Step 4: postMessage to build communication.'); |
(...skipping 25 matching lines...) Expand all Loading... |
1111 } | 1111 } |
1112 | 1112 |
1113 // This test verifies the content script won't be removed when the guest is | 1113 // This test verifies the content script won't be removed when the guest is |
1114 // destroyed, i.e., removed <webview> from the DOM. | 1114 // destroyed, i.e., removed <webview> from the DOM. |
1115 function testContentScriptExistsAsLongAsWebViewTagExists() { | 1115 function testContentScriptExistsAsLongAsWebViewTagExists() { |
1116 var webview = document.createElement('webview'); | 1116 var webview = document.createElement('webview'); |
1117 | 1117 |
1118 console.log('Step 1: call <webview>.addContentScripts.'); | 1118 console.log('Step 1: call <webview>.addContentScripts.'); |
1119 webview.addContentScripts( | 1119 webview.addContentScripts( |
1120 [{"name": 'myrule', | 1120 [{"name": 'myrule', |
1121 "matches": ["http://*/extensions/*"], | 1121 "matches": ['http://*/extensions/*'], |
1122 "js": ["simple_script.js"], | 1122 "js": ['simple_script.js'], |
1123 "run_at": "document_end"}]); | 1123 "run_at": 'document_end'}]); |
1124 | 1124 |
1125 var count = 0; | 1125 var count = 0; |
1126 webview.addEventListener('loadstop', function() { | 1126 webview.addEventListener('loadstop', function() { |
1127 if (count == 0) { | 1127 if (count == 0) { |
1128 console.log('Step 2: check the result of content script injected.'); | 1128 console.log('Step 2: check the result of content script injected.'); |
1129 webview.executeScript({ | 1129 webview.executeScript({ |
1130 code: 'document.body.style.backgroundColor;' | 1130 code: 'document.body.style.backgroundColor;' |
1131 }, function(results) { | 1131 }, function(results) { |
1132 embedder.test.assertEq(1, results.length); | 1132 embedder.test.assertEq(1, results.length); |
1133 embedder.test.assertEq('red', results[0]); | 1133 embedder.test.assertEq('red', results[0]); |
(...skipping 15 matching lines...) Expand all Loading... |
1149 embedder.test.assertEq('red', results[0]); | 1149 embedder.test.assertEq('red', results[0]); |
1150 embedder.test.succeed(); | 1150 embedder.test.succeed(); |
1151 }); | 1151 }); |
1152 } | 1152 } |
1153 }); | 1153 }); |
1154 | 1154 |
1155 webview.src = embedder.emptyGuestURL; | 1155 webview.src = embedder.emptyGuestURL; |
1156 document.body.appendChild(webview); | 1156 document.body.appendChild(webview); |
1157 } | 1157 } |
1158 | 1158 |
| 1159 function testAddContentScriptWithCode() { |
| 1160 var webview = document.createElement('webview'); |
| 1161 |
| 1162 console.log('Step 1: call <webview>.addContentScripts.'); |
| 1163 webview.addContentScripts( |
| 1164 [{"name": 'myrule', |
| 1165 "matches": ['http://*/extensions/*'], |
| 1166 "code": 'document.body.style.backgroundColor = \'red\';', |
| 1167 "run_at": 'document_end'}]); |
| 1168 |
| 1169 webview.addEventListener('loadstop', function() { |
| 1170 console.log('Step 2: call webview.executeScript() to check result.') |
| 1171 webview.executeScript({ |
| 1172 code: 'document.body.style.backgroundColor;'}, |
| 1173 function(results) { |
| 1174 embedder.test.assertEq(1, results.length); |
| 1175 embedder.test.assertEq('red', results[0]); |
| 1176 embedder.test.succeed(); |
| 1177 }); |
| 1178 }); |
| 1179 |
| 1180 webview.src = embedder.emptyGuestURL; |
| 1181 document.body.appendChild(webview); |
| 1182 } |
| 1183 |
1159 function testExecuteScriptFail() { | 1184 function testExecuteScriptFail() { |
1160 var webview = document.createElement('webview'); | 1185 var webview = document.createElement('webview'); |
1161 document.body.appendChild(webview); | 1186 document.body.appendChild(webview); |
1162 setTimeout(function() { | 1187 setTimeout(function() { |
1163 webview.executeScript( | 1188 webview.executeScript( |
1164 {code:'document.body.style.backgroundColor = "red";'}, | 1189 {code:'document.body.style.backgroundColor = "red";'}, |
1165 function(results) { | 1190 function(results) { |
1166 embedder.test.fail(); | 1191 embedder.test.fail(); |
1167 }); | 1192 }); |
1168 setTimeout(function() { | 1193 setTimeout(function() { |
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2652 testAddContentScriptWithSameNameShouldOverwriteTheExistingOne, | 2677 testAddContentScriptWithSameNameShouldOverwriteTheExistingOne, |
2653 'testAddContentScriptToOneWebViewShouldNotInjectToTheOtherWebView': | 2678 'testAddContentScriptToOneWebViewShouldNotInjectToTheOtherWebView': |
2654 testAddContentScriptToOneWebViewShouldNotInjectToTheOtherWebView, | 2679 testAddContentScriptToOneWebViewShouldNotInjectToTheOtherWebView, |
2655 'testAddAndRemoveContentScripts': testAddAndRemoveContentScripts, | 2680 'testAddAndRemoveContentScripts': testAddAndRemoveContentScripts, |
2656 'testAddContentScriptsWithNewWindowAPI': | 2681 'testAddContentScriptsWithNewWindowAPI': |
2657 testAddContentScriptsWithNewWindowAPI, | 2682 testAddContentScriptsWithNewWindowAPI, |
2658 'testContentScriptIsInjectedAfterTerminateAndReloadWebView': | 2683 'testContentScriptIsInjectedAfterTerminateAndReloadWebView': |
2659 testContentScriptIsInjectedAfterTerminateAndReloadWebView, | 2684 testContentScriptIsInjectedAfterTerminateAndReloadWebView, |
2660 'testContentScriptExistsAsLongAsWebViewTagExists': | 2685 'testContentScriptExistsAsLongAsWebViewTagExists': |
2661 testContentScriptExistsAsLongAsWebViewTagExists, | 2686 testContentScriptExistsAsLongAsWebViewTagExists, |
| 2687 'testAddContentScriptWithCode': testAddContentScriptWithCode, |
2662 'testExecuteScriptFail': testExecuteScriptFail, | 2688 'testExecuteScriptFail': testExecuteScriptFail, |
2663 'testExecuteScript': testExecuteScript, | 2689 'testExecuteScript': testExecuteScript, |
2664 'testExecuteScriptIsAbortedWhenWebViewSourceIsChanged': | 2690 'testExecuteScriptIsAbortedWhenWebViewSourceIsChanged': |
2665 testExecuteScriptIsAbortedWhenWebViewSourceIsChanged, | 2691 testExecuteScriptIsAbortedWhenWebViewSourceIsChanged, |
2666 'testTerminateAfterExit': testTerminateAfterExit, | 2692 'testTerminateAfterExit': testTerminateAfterExit, |
2667 'testAssignSrcAfterCrash': testAssignSrcAfterCrash, | 2693 'testAssignSrcAfterCrash': testAssignSrcAfterCrash, |
2668 'testNavOnConsecutiveSrcAttributeChanges': | 2694 'testNavOnConsecutiveSrcAttributeChanges': |
2669 testNavOnConsecutiveSrcAttributeChanges, | 2695 testNavOnConsecutiveSrcAttributeChanges, |
2670 'testNavOnSrcAttributeChange': testNavOnSrcAttributeChange, | 2696 'testNavOnSrcAttributeChange': testNavOnSrcAttributeChange, |
2671 'testReassignSrcAttribute': testReassignSrcAttribute, | 2697 'testReassignSrcAttribute': testReassignSrcAttribute, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2719 'testDisabledZoomMode': testDisabledZoomMode, | 2745 'testDisabledZoomMode': testDisabledZoomMode, |
2720 'testPlugin': testPlugin, | 2746 'testPlugin': testPlugin, |
2721 }; | 2747 }; |
2722 | 2748 |
2723 onload = function() { | 2749 onload = function() { |
2724 chrome.test.getConfig(function(config) { | 2750 chrome.test.getConfig(function(config) { |
2725 embedder.setUp_(config); | 2751 embedder.setUp_(config); |
2726 chrome.test.sendMessage("Launched"); | 2752 chrome.test.sendMessage("Launched"); |
2727 }); | 2753 }); |
2728 }; | 2754 }; |
OLD | NEW |