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

Side by Side Diff: test/BaseJsTest.h

Issue 10862008: Automatically add default filter subscription when necessary. (Closed)
Patch Set: Created May 27, 2013, 2:12 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 | « test/AppInfoJsObject.cpp ('k') | test/FilterEngine.cpp » ('j') | 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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 class LazyWebRequest : public AdblockPlus::WebRequest 121 class LazyWebRequest : public AdblockPlus::WebRequest
122 { 122 {
123 AdblockPlus::ServerResponse GET(const std::string& url, const AdblockPlus::Hea derList& requestHeaders) const 123 AdblockPlus::ServerResponse GET(const std::string& url, const AdblockPlus::Hea derList& requestHeaders) const
124 { 124 {
125 while (true) 125 while (true)
126 AdblockPlus::Sleep(100000); 126 AdblockPlus::Sleep(100000);
127 return AdblockPlus::ServerResponse(); 127 return AdblockPlus::ServerResponse();
128 } 128 }
129 }; 129 };
130 130
131 class LazyLogSystem : public AdblockPlus::LogSystem
132 {
133 void operator()(LogLevel logLevel, const std::string& message,
134 const std::string& source)
135 {
136 }
137 };
131 138
132 class BaseJsTest : public ::testing::Test 139 class BaseJsTest : public ::testing::Test
133 { 140 {
134 protected: 141 protected:
135 AdblockPlus::JsEnginePtr jsEngine; 142 AdblockPlus::JsEnginePtr jsEngine;
136 143
137 virtual void SetUp() 144 virtual void SetUp()
138 { 145 {
139 jsEngine = AdblockPlus::JsEngine::New(); 146 jsEngine = AdblockPlus::JsEngine::New();
140 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new ThrowingLogSystem)); 147 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new ThrowingLogSystem));
141 jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new ThrowingFileSystem)); 148 jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new ThrowingFileSystem));
142 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new ThrowingWebRequest)); 149 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new ThrowingWebRequest));
143 } 150 }
144 }; 151 };
145 152
146 #endif 153 #endif
OLDNEW
« no previous file with comments | « test/AppInfoJsObject.cpp ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld