Index: test/FilterEngine.cpp |
=================================================================== |
--- a/test/FilterEngine.cpp |
+++ b/test/FilterEngine.cpp |
@@ -19,20 +19,19 @@ |
namespace |
{ |
typedef std::tr1::shared_ptr<AdblockPlus::FilterEngine> FilterEnginePtr; |
class VeryLazyFileSystem : public LazyFileSystem |
{ |
public: |
- std::tr1::shared_ptr<std::istream> Read(const std::string& path) const |
+ StatResult Stat(const std::string& path) const |
{ |
- std::string dummyData("# Adblock Plus preferences"); |
- return std::tr1::shared_ptr<std::istream>(new std::istringstream(dummyData)); |
+ return StatResult(); |
} |
}; |
template<class FileSystem, class LogSystem> |
class FilterEngineTestGeneric : public BaseJsTest |
{ |
protected: |
FilterEnginePtr filterEngine; |
@@ -116,34 +115,33 @@ TEST_F(FilterEngineTest, SubscriptionPro |
subscription->SetProperty("boolFoo", true); |
ASSERT_EQ("y", subscription->GetProperty("stringFoo")->AsString()); |
ASSERT_EQ(24, subscription->GetProperty("intFoo")->AsInt()); |
ASSERT_TRUE(subscription->GetProperty("boolFoo")->AsBool()); |
} |
TEST_F(FilterEngineTest, AddRemoveSubscriptions) |
{ |
- // There should be only the default subscription initially |
- ASSERT_EQ(1u, filterEngine->GetListedSubscriptions().size()); |
+ ASSERT_EQ(0u, filterEngine->GetListedSubscriptions().size()); |
AdblockPlus::SubscriptionPtr subscription = filterEngine->GetSubscription("foo"); |
- ASSERT_EQ(1u, filterEngine->GetListedSubscriptions().size()); |
+ ASSERT_EQ(0u, filterEngine->GetListedSubscriptions().size()); |
ASSERT_FALSE(subscription->IsListed()); |
subscription->AddToList(); |
- ASSERT_EQ(2u, filterEngine->GetListedSubscriptions().size()); |
- ASSERT_EQ(*subscription, *filterEngine->GetListedSubscriptions()[1]); |
+ ASSERT_EQ(1u, filterEngine->GetListedSubscriptions().size()); |
+ ASSERT_EQ(*subscription, *filterEngine->GetListedSubscriptions()[0]); |
ASSERT_TRUE(subscription->IsListed()); |
subscription->AddToList(); |
- ASSERT_EQ(2u, filterEngine->GetListedSubscriptions().size()); |
- ASSERT_EQ(*subscription, *filterEngine->GetListedSubscriptions()[1]); |
+ ASSERT_EQ(1u, filterEngine->GetListedSubscriptions().size()); |
+ ASSERT_EQ(*subscription, *filterEngine->GetListedSubscriptions()[0]); |
ASSERT_TRUE(subscription->IsListed()); |
subscription->RemoveFromList(); |
- ASSERT_EQ(1u, filterEngine->GetListedSubscriptions().size()); |
+ ASSERT_EQ(0u, filterEngine->GetListedSubscriptions().size()); |
ASSERT_FALSE(subscription->IsListed()); |
subscription->RemoveFromList(); |
- ASSERT_EQ(1u, filterEngine->GetListedSubscriptions().size()); |
+ ASSERT_EQ(0u, filterEngine->GetListedSubscriptions().size()); |
ASSERT_FALSE(subscription->IsListed()); |
} |
TEST_F(FilterEngineTest, SubscriptionUpdates) |
{ |
AdblockPlus::SubscriptionPtr subscription = filterEngine->GetSubscription("foo"); |
ASSERT_FALSE(subscription->IsUpdating()); |
subscription->UpdateFilters(); |
@@ -306,10 +304,10 @@ TEST_F(FilterEngineTest, MatchesNestedFr |
TEST_F(FilterEngineTest, FirstRunFlag) |
{ |
ASSERT_FALSE(filterEngine->IsFirstRun()); |
} |
TEST_F(FilterEngineTestNoData, FirstRunFlag) |
{ |
- ASSERT_FALSE(filterEngine->IsFirstRun()); |
+ ASSERT_TRUE(filterEngine->IsFirstRun()); |
} |