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

Delta Between Two Patch Sets: test/FilterEngine.cpp

Issue 29402569: Issue 5074 - fix tests for "is allowed connection" (Closed)
Left Patch Set: Created April 4, 2017, 10:51 a.m.
Right Patch Set: fix android build Created April 4, 2017, 12:20 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | test/WebRequest.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 #include "BaseJsTest.h" 18 #include "BaseJsTest.h"
19 #include <thread> 19 #include <thread>
20 #include "../src/Utils.h"
21 #include <condition_variable> 20 #include <condition_variable>
22 21
23 using namespace AdblockPlus; 22 using namespace AdblockPlus;
23
24 namespace AdblockPlus
25 {
26 namespace Utils
27 {
28 inline bool BeginsWith(const std::string& str, const std::string& beginning)
29 {
30 return 0 == str.compare(0, beginning.size(), beginning);
31 }
32 }
33 }
24 34
25 namespace 35 namespace
26 { 36 {
27 class VeryLazyFileSystem : public LazyFileSystem 37 class VeryLazyFileSystem : public LazyFileSystem
28 { 38 {
29 public: 39 public:
30 StatResult Stat(const std::string& path) const 40 StatResult Stat(const std::string& path) const
31 { 41 {
32 return StatResult(); 42 return StatResult();
33 } 43 }
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 filterEngine->SetAllowedConnectionType(&testConnection); 836 filterEngine->SetAllowedConnectionType(&testConnection);
827 auto subscription = EnsureExampleSubscriptionAndForceUpdate("subB"); 837 auto subscription = EnsureExampleSubscriptionAndForceUpdate("subB");
828 EXPECT_EQ("synchronize_ok", subscription->GetProperty("downloadStatus")->AsS tring()); 838 EXPECT_EQ("synchronize_ok", subscription->GetProperty("downloadStatus")->AsS tring());
829 EXPECT_EQ(1u, subscription->GetProperty("filters")->AsList().size()); 839 EXPECT_EQ(1u, subscription->GetProperty("filters")->AsList().size());
830 auto capturedConnectionTypes = this->capturedConnectionTypes.GetStrings(); 840 auto capturedConnectionTypes = this->capturedConnectionTypes.GetStrings();
831 ASSERT_EQ(1u, capturedConnectionTypes.size()); 841 ASSERT_EQ(1u, capturedConnectionTypes.size());
832 EXPECT_TRUE(capturedConnectionTypes[0].first); 842 EXPECT_TRUE(capturedConnectionTypes[0].first);
833 EXPECT_EQ(testConnection, capturedConnectionTypes[0].second); 843 EXPECT_EQ(testConnection, capturedConnectionTypes[0].second);
834 } 844 }
835 } 845 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld