OLD | NEW |
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 Loading... |
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 |
OLD | NEW |