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

Side by Side Diff: test/wrappers/pages.js

Issue 29891661: Noissue - Fixed test pages integration tests after change of subscription URL (Closed)
Patch Set: Created Sept. 25, 2018, 4:07 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
« no previous file with comments | « no previous file | 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 "use strict"; 18 "use strict";
19 19
20 const TEST_PAGES_URL = "https://testpages.adblockplus.org/"; 20 const TEST_PAGES_URL = "https://testpages.adblockplus.org/en/";
Sebastian Noack 2018/09/25 16:12:06 Today a change landed for the test pages that caus
21 21
22 const assert = require("assert"); 22 const assert = require("assert");
23 const Jimp = require("jimp"); 23 const Jimp = require("jimp");
24 const {By} = require("selenium-webdriver"); 24 const {By} = require("selenium-webdriver");
25 25
26 // Once we require Node.js >= 10 this should be replaced with 26 // Once we require Node.js >= 10 this should be replaced with
27 // the built-in finally() method of the Promise object. 27 // the built-in finally() method of the Promise object.
28 function promiseFinally(p, callback) 28 function promiseFinally(p, callback)
29 { 29 {
30 return p.then( 30 return p.then(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 return dialog.findElement(By.css("button")).click(); 73 return dialog.findElement(By.css("button")).click();
74 }) 74 })
75 ).then(() => 75 ).then(() =>
76 driver.executeAsyncScript(` 76 driver.executeAsyncScript(`
77 let callback = arguments[arguments.length - 1]; 77 let callback = arguments[arguments.length - 1];
78 browser.runtime.sendMessage({type: "subscriptions.get", 78 browser.runtime.sendMessage({type: "subscriptions.get",
79 ignoreDisabled: true, 79 ignoreDisabled: true,
80 downloadable: true}).then(subs => 80 downloadable: true}).then(subs =>
81 subs.some(s => 81 subs.some(s =>
82 s.url.endsWith("${TEST_PAGES_URL.replace(/^[^:]+/, "")}" + 82 s.url == "${TEST_PAGES_URL}abp-testcase-subscription.txt"
Sebastian Noack 2018/09/25 16:12:06 This was neccessary before, but no longer, because
83 "abp-testcase-subscription.txt")
84 ) 83 )
85 ).then( 84 ).then(
86 res => callback([res, null]), 85 res => callback([res, null]),
87 err => callback([null, err]) 86 err => callback([null, err])
88 ); 87 );
89 `) 88 `)
90 ).then(([added, err]) => 89 ).then(([added, err]) =>
91 { 90 {
92 if (err) 91 if (err)
93 throw err; 92 throw err;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 title 244 title
246 ) 245 )
247 ); 246 );
248 }); 247 });
249 } 248 }
250 return p2; 249 return p2;
251 }); 250 });
252 return p1; 251 return p1;
253 }); 252 });
254 }); 253 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld