LEFT | RIGHT |
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 Loading... |
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 Loading... |
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 } |
LEFT | RIGHT |