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

Side by Side Diff: test/BaseJsTest.h

Issue 10800079: Implemented update checking functionality (Closed)
Patch Set: Created June 5, 2013, 1:40 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
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 std::string Resolve(const std::string& path) const 117 std::string Resolve(const std::string& path) const
118 { 118 {
119 return path; 119 return path;
120 } 120 }
121 }; 121 };
122 122
123 class LazyWebRequest : public AdblockPlus::WebRequest 123 class LazyWebRequest : public AdblockPlus::WebRequest
124 { 124 {
125 public:
125 AdblockPlus::ServerResponse GET(const std::string& url, const AdblockPlus::Hea derList& requestHeaders) const 126 AdblockPlus::ServerResponse GET(const std::string& url, const AdblockPlus::Hea derList& requestHeaders) const
126 { 127 {
127 while (true) 128 while (true)
128 AdblockPlus::Sleep(100000); 129 AdblockPlus::Sleep(100000);
129 return AdblockPlus::ServerResponse(); 130 return AdblockPlus::ServerResponse();
130 } 131 }
131 }; 132 };
132 133
133 class LazyLogSystem : public AdblockPlus::LogSystem 134 class LazyLogSystem : public AdblockPlus::LogSystem
134 { 135 {
136 public:
135 void operator()(LogLevel logLevel, const std::string& message, 137 void operator()(LogLevel logLevel, const std::string& message,
136 const std::string& source) 138 const std::string& source)
137 { 139 {
138 } 140 }
139 }; 141 };
140 142
141 class BaseJsTest : public ::testing::Test 143 class BaseJsTest : public ::testing::Test
142 { 144 {
143 protected: 145 protected:
144 AdblockPlus::JsEnginePtr jsEngine; 146 AdblockPlus::JsEnginePtr jsEngine;
145 147
146 virtual void SetUp() 148 virtual void SetUp()
147 { 149 {
148 jsEngine = AdblockPlus::JsEngine::New(); 150 jsEngine = AdblockPlus::JsEngine::New();
149 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new ThrowingLogSystem)); 151 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new ThrowingLogSystem));
150 jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new ThrowingFileSystem)); 152 jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new ThrowingFileSystem));
151 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new ThrowingWebRequest)); 153 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new ThrowingWebRequest));
152 } 154 }
153 }; 155 };
154 156
155 #endif 157 #endif
OLDNEW
« lib/updater.js ('K') | « src/FilterEngine.cpp ('k') | test/UpdateCheck.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld