Fix API tests after r181754.
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Mar 2015 20:50:18 +0000 (20:50 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Mar 2015 20:50:18 +0000 (20:50 +0000)
* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::testRequest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181755 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp

index 5864845..0a47746 100644 (file)
@@ -1,3 +1,10 @@
+2015-03-19  Alex Christensen  <achristensen@webkit.org>
+
+        Fix API tests after r181754.
+
+        * TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
+        (TestWebKitAPI::testRequest):
+
 2015-03-19  Brady Eidson  <beidson@apple.com>
 
         Part of content extensions should apply css selectors
index 78b83e8..10e114a 100644 (file)
@@ -101,8 +101,9 @@ private:
 void static testRequest(ContentExtensions::ContentExtensionsBackend contentExtensionsBackend, const ResourceLoadInfo& resourceLoadInfo, Vector<ContentExtensions::ActionType> expectedActions)
 {
     auto actions = contentExtensionsBackend.actionsForResourceLoad(resourceLoadInfo);
-    EXPECT_EQ(expectedActions.size(), actions.size());
-    if (expectedActions.size() != actions.size())
+    // The last action is applying the compiled stylesheet.
+    EXPECT_EQ(expectedActions.size(), actions.size() ? actions.size() - 1 : 0);
+    if (expectedActions.size() != (actions.size() ? actions.size() - 1 : 0))
         return;
 
     for (unsigned i = 0; i < expectedActions.size(); ++i)