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

Delta Between Two Patch Sets: test/FilterEngine.cpp

Issue 29449592: Issue 5183 - Provide async interface for FileSystem (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Left Patch Set: Updated patch after review. Created June 16, 2017, 9:52 p.m.
Right Patch Set: Rebase on master. Last changes. Created July 7, 2017, 1:36 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 | « test/FileSystemJsObject.cpp ('k') | test/JsEngine.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
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if (error.empty() && stats.exists) 117 if (error.empty() && stats.exists)
118 { 118 {
119 fs->Remove(path, [&sync](const std::string& error) 119 fs->Remove(path, [&sync](const std::string& error)
120 { 120 {
121 sync.Set(error); 121 sync.Set(error);
122 }); 122 });
123 } 123 }
124 else 124 else
125 sync.Set(error); 125 sync.Set(error);
126 }); 126 });
127 sync.Wait(); 127 sync.WaitFor();
128 return sync.GetError().empty(); 128 return sync.GetError().empty();
129 } 129 }
130 catch (...) 130 catch (...)
131 { 131 {
132 return false; 132 return false;
133 } 133 }
134 }; 134 };
135 int i = 5; 135 int i = 5;
136 while ((i-- > 0 && weakJsEngine.lock()) || !safeRemove()) 136 while ((i-- > 0 && weakJsEngine.lock()) || !safeRemove())
137 std::this_thread::sleep_for(std::chrono::seconds(2)); 137 std::this_thread::sleep_for(std::chrono::seconds(2));
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 std::string testConnection = "test connection"; 1025 std::string testConnection = "test connection";
1026 filterEngine->SetAllowedConnectionType(&testConnection); 1026 filterEngine->SetAllowedConnectionType(&testConnection);
1027 auto subscription = EnsureExampleSubscriptionAndForceUpdate("subB"); 1027 auto subscription = EnsureExampleSubscriptionAndForceUpdate("subB");
1028 EXPECT_EQ("synchronize_ok", subscription.GetProperty("downloadStatus").AsStr ing()); 1028 EXPECT_EQ("synchronize_ok", subscription.GetProperty("downloadStatus").AsStr ing());
1029 EXPECT_EQ(1u, subscription.GetProperty("filters").AsList().size()); 1029 EXPECT_EQ(1u, subscription.GetProperty("filters").AsList().size());
1030 ASSERT_EQ(1u, capturedConnectionTypes.size()); 1030 ASSERT_EQ(1u, capturedConnectionTypes.size());
1031 EXPECT_TRUE(capturedConnectionTypes[0].first); 1031 EXPECT_TRUE(capturedConnectionTypes[0].first);
1032 EXPECT_EQ(testConnection, capturedConnectionTypes[0].second); 1032 EXPECT_EQ(testConnection, capturedConnectionTypes[0].second);
1033 } 1033 }
1034 } 1034 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld