Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: test/browser/snippets.js

Issue 30033574: Issue 7419 - Allow wrapping function for abort-on-property-* (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created March 28, 2019, 8:39 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« lib/content/snippets.js ('K') | « lib/content/snippets.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 window.abpTest5 = 42; 102 window.abpTest5 = 42;
103 await runSnippet(test, "abort-on-property-read", "abpTest5.prop4.bar"); 103 await runSnippet(test, "abort-on-property-read", "abpTest5.prop4.bar");
104 104
105 testProperty("abpTest5.prop4.bar", true, "TypeError"); 105 testProperty("abpTest5.prop4.bar", true, "TypeError");
106 106
107 window.abpTest5 = {prop4: 42}; 107 window.abpTest5 = {prop4: 42};
108 testProperty("abpTest5.prop4.bar", false); 108 testProperty("abpTest5.prop4.bar", false);
109 window.abpTest5 = {prop4: {}}; 109 window.abpTest5 = {prop4: {}};
110 testProperty("abpTest5.prop4.bar"); 110 testProperty("abpTest5.prop4.bar");
111 111
112 // Check that it works on properties that are functions.
113 // https://issues.adblockplus.org/ticket/7419
114 await runSnippet(test, "abort-on-property-read", "Object.keys");
Manish Jethani 2019/03/29 07:08:07 In the interest of completeness we could add the f
hub 2019/03/29 14:36:27 for the record, test 8 and 9 already pass. But tha
Manish Jethani 2019/03/29 15:46:27 The reason I thought we should add these tests is
hub 2019/03/29 15:58:02 I was not arguing against. I was just indicating t
Manish Jethani 2019/03/29 15:59:09 Acknowledged.
115 testProperty("Object.keys");
116
112 test.done(); 117 test.done();
113 }; 118 };
114 119
115 exports.testAbortCurrentInlineScriptSnippet = async function(test) 120 exports.testAbortCurrentInlineScriptSnippet = async function(test)
116 { 121 {
117 function injectInlineScript(doc, script) 122 function injectInlineScript(doc, script)
118 { 123 {
119 let scriptElement = doc.createElement("script"); 124 let scriptElement = doc.createElement("script");
120 scriptElement.type = "application/javascript"; 125 scriptElement.type = "application/javascript";
121 scriptElement.async = false; 126 scriptElement.async = false;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 188
184 if (e && msg) 189 if (e && msg)
185 { 190 {
186 test.equals(e.textContent, "", "result element should be empty"); 191 test.equals(e.textContent, "", "result element should be empty");
187 test.equals(msg.textContent, "ReferenceError", 192 test.equals(msg.textContent, "ReferenceError",
188 "There should have been an error"); 193 "There should have been an error");
189 } 194 }
190 195
191 test.done(); 196 test.done();
192 }; 197 };
OLDNEW
« lib/content/snippets.js ('K') | « lib/content/snippets.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld