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

Side by Side Diff: test/FilterEngine.cpp

Issue 6233220328718336: Issue #3593, #1197- fix isolate management (Closed)
Patch Set: make ScopedV8Isolate uncopyable Created Jan. 22, 2016, 10:39 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 }; 78 };
79 79
80 MockWebRequest* mockWebRequest; 80 MockWebRequest* mockWebRequest;
81 FilterEnginePtr filterEngine; 81 FilterEnginePtr filterEngine;
82 82
83 void SetUp() 83 void SetUp()
84 { 84 {
85 AdblockPlus::AppInfo appInfo; 85 AdblockPlus::AppInfo appInfo;
86 appInfo.name = "test"; 86 appInfo.name = "test";
87 appInfo.version = "1.0.1"; 87 appInfo.version = "1.0.1";
Eric 2016/01/26 14:48:59 It would be a good idea to move this code into "Cr
88 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::New(appInfo); 88 AdblockPlus::JsEnginePtr jsEngine = createJsEngine(appInfo);
89 jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new LazyFileSystem)); 89 jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new LazyFileSystem));
90 mockWebRequest = new MockWebRequest; 90 mockWebRequest = new MockWebRequest;
91 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(mockWebRequest)); 91 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(mockWebRequest));
92 filterEngine = FilterEnginePtr(new AdblockPlus::FilterEngine(jsEngine)); 92 filterEngine = FilterEnginePtr(new AdblockPlus::FilterEngine(jsEngine));
93 } 93 }
94 }; 94 };
95 95
96 struct MockUpdateAvailableCallback 96 struct MockUpdateAvailableCallback
97 { 97 {
98 MockUpdateAvailableCallback(int& timesCalled) : timesCalled(timesCalled) {} 98 MockUpdateAvailableCallback(int& timesCalled) : timesCalled(timesCalled) {}
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 documentUrls1.push_back("http://example.de"); 464 documentUrls1.push_back("http://example.de");
465 465
466 ASSERT_TRUE(filterEngine->IsElemhideWhitelisted( 466 ASSERT_TRUE(filterEngine->IsElemhideWhitelisted(
467 "http://example.com", 467 "http://example.com",
468 documentUrls1)); 468 documentUrls1));
469 469
470 ASSERT_FALSE(filterEngine->IsElemhideWhitelisted( 470 ASSERT_FALSE(filterEngine->IsElemhideWhitelisted(
471 "http://example.co.uk", 471 "http://example.co.uk",
472 documentUrls1)); 472 documentUrls1));
473 } 473 }
OLDNEW
« test/BaseJsTest.cpp ('K') | « test/BaseJsTest.cpp ('k') | test/Prefs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld