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

Delta Between Two Patch Sets: test/FilterEngine.cpp

Issue 29424663: Issue 5198 - workaround for race condition in tests (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Left Patch Set: Created April 28, 2017, 10:32 a.m.
Right Patch Set: add comment Created April 28, 2017, 1:12 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 | no next file » | 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
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 FilterEnginePtr filterEngine; 50 FilterEnginePtr filterEngine;
51 51
52 void SetUp() 52 void SetUp()
53 { 53 {
54 BaseJsTest::SetUp(); 54 BaseJsTest::SetUp();
55 jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new FileSystem)); 55 jsEngine->SetFileSystem(AdblockPlus::FileSystemPtr(new FileSystem));
56 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new LazyWebRequest)); 56 jsEngine->SetWebRequest(AdblockPlus::WebRequestPtr(new LazyWebRequest));
57 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LogSystem)); 57 jsEngine->SetLogSystem(AdblockPlus::LogSystemPtr(new LogSystem));
58 filterEngine = AdblockPlus::FilterEngine::Create(jsEngine); 58 filterEngine = AdblockPlus::FilterEngine::Create(jsEngine);
59 } 59 }
60 void TearDown() override 60 void TearDown() override
hub 2017/04/28 13:07:23 I would add a comment here to point at the actual
sergei 2017/04/28 13:14:33 Agree, I thought that one will later trace it usin
61 { 61 {
62 // Workaround for issue 5198
62 std::this_thread::sleep_for(std::chrono::milliseconds(100)); 63 std::this_thread::sleep_for(std::chrono::milliseconds(100));
63 } 64 }
64 }; 65 };
65 66
66 typedef FilterEngineTestGeneric<LazyFileSystem, AdblockPlus::DefaultLogSystem> FilterEngineTest; 67 typedef FilterEngineTestGeneric<LazyFileSystem, AdblockPlus::DefaultLogSystem> FilterEngineTest;
67 typedef FilterEngineTestGeneric<VeryLazyFileSystem, LazyLogSystem> FilterEngin eTestNoData; 68 typedef FilterEngineTestGeneric<VeryLazyFileSystem, LazyLogSystem> FilterEngin eTestNoData;
68 69
69 class UpdaterTest : public ::testing::Test 70 class UpdaterTest : public ::testing::Test
70 { 71 {
71 protected: 72 protected:
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 filterEngine->SetAllowedConnectionType(&testConnection); 1082 filterEngine->SetAllowedConnectionType(&testConnection);
1082 auto subscription = EnsureExampleSubscriptionAndForceUpdate("subB"); 1083 auto subscription = EnsureExampleSubscriptionAndForceUpdate("subB");
1083 EXPECT_EQ("synchronize_ok", subscription.GetProperty("downloadStatus").AsStr ing()); 1084 EXPECT_EQ("synchronize_ok", subscription.GetProperty("downloadStatus").AsStr ing());
1084 EXPECT_EQ(1u, subscription.GetProperty("filters").AsList().size()); 1085 EXPECT_EQ(1u, subscription.GetProperty("filters").AsList().size());
1085 auto capturedConnectionTypes = this->capturedConnectionTypes.GetStrings(); 1086 auto capturedConnectionTypes = this->capturedConnectionTypes.GetStrings();
1086 ASSERT_EQ(1u, capturedConnectionTypes.size()); 1087 ASSERT_EQ(1u, capturedConnectionTypes.size());
1087 EXPECT_TRUE(capturedConnectionTypes[0].first); 1088 EXPECT_TRUE(capturedConnectionTypes[0].first);
1088 EXPECT_EQ(testConnection, capturedConnectionTypes[0].second); 1089 EXPECT_EQ(testConnection, capturedConnectionTypes[0].second);
1089 } 1090 }
1090 } 1091 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld