| OLD | NEW |
| 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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 ASSERT_TRUE(filterEngine->IsFirstRun()); | 436 ASSERT_TRUE(filterEngine->IsFirstRun()); |
| 437 } | 437 } |
| 438 | 438 |
| 439 TEST_F(FilterEngineTest, SetRemoveFilterChangeCallback) | 439 TEST_F(FilterEngineTest, SetRemoveFilterChangeCallback) |
| 440 { | 440 { |
| 441 int timesCalled = 0; | 441 int timesCalled = 0; |
| 442 MockFilterChangeCallback mockFilterChangeCallback(timesCalled); | 442 MockFilterChangeCallback mockFilterChangeCallback(timesCalled); |
| 443 | 443 |
| 444 filterEngine->SetFilterChangeCallback(mockFilterChangeCallback); | 444 filterEngine->SetFilterChangeCallback(mockFilterChangeCallback); |
| 445 filterEngine->GetFilter("foo")->AddToList(); | 445 filterEngine->GetFilter("foo")->AddToList(); |
| 446 EXPECT_EQ(2, timesCalled); | 446 EXPECT_EQ(1, timesCalled); |
| 447 | 447 |
| 448 filterEngine->RemoveFilterChangeCallback(); | 448 filterEngine->RemoveFilterChangeCallback(); |
| 449 filterEngine->GetFilter("foo")->RemoveFromList(); | 449 filterEngine->GetFilter("foo")->RemoveFromList(); |
| 450 EXPECT_EQ(2, timesCalled); | 450 EXPECT_EQ(1, timesCalled); |
| 451 } | 451 } |
| 452 | 452 |
| 453 TEST_F(UpdaterTest, SetRemoveUpdateAvailableCallback) | 453 TEST_F(UpdaterTest, SetRemoveUpdateAvailableCallback) |
| 454 { | 454 { |
| 455 mockWebRequest->response.status = 0; | 455 mockWebRequest->response.status = 0; |
| 456 mockWebRequest->response.responseStatus = 200; | 456 mockWebRequest->response.responseStatus = 200; |
| 457 mockWebRequest->response.responseText = "\ | 457 mockWebRequest->response.responseText = "\ |
| 458 {\ | 458 {\ |
| 459 \"test\": {\ | 459 \"test\": {\ |
| 460 \"version\": \"1.0.2\",\ | 460 \"version\": \"1.0.2\",\ |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 documentUrls1.push_back("http://example.de"); | 526 documentUrls1.push_back("http://example.de"); |
| 527 | 527 |
| 528 ASSERT_TRUE(filterEngine->IsElemhideWhitelisted( | 528 ASSERT_TRUE(filterEngine->IsElemhideWhitelisted( |
| 529 "http://example.com", | 529 "http://example.com", |
| 530 documentUrls1)); | 530 documentUrls1)); |
| 531 | 531 |
| 532 ASSERT_FALSE(filterEngine->IsElemhideWhitelisted( | 532 ASSERT_FALSE(filterEngine->IsElemhideWhitelisted( |
| 533 "http://example.co.uk", | 533 "http://example.co.uk", |
| 534 documentUrls1)); | 534 documentUrls1)); |
| 535 } | 535 } |
| OLD | NEW |