| Index: test/WebRequest.cpp |
| =================================================================== |
| --- a/test/WebRequest.cpp |
| +++ b/test/WebRequest.cpp |
| @@ -119,17 +119,17 @@ TEST_F(MockWebRequestTest, ConnectionIsA |
| jsEngine->SetIsConnectionAllowedCallback([&isConnectionAllowedCalledTimes]()->bool |
| { |
| ++isConnectionAllowedCalledTimes; |
| return true; |
| }); |
| jsEngine->Evaluate("_webRequest.GET('http://example.com/', {X: 'Y'}, function(result) {foo = result;} )"); |
| ASSERT_TRUE(jsEngine->Evaluate("this.foo")->IsUndefined()); |
| AdblockPlus::Sleep(200); |
| - EXPECT_EQ(1u, isConnectionAllowedCalledTimes); |
| + EXPECT_EQ(1, isConnectionAllowedCalledTimes); |
| EXPECT_EQ(AdblockPlus::WebRequest::NS_OK, jsEngine->Evaluate("foo.status")->AsInt()); |
| EXPECT_EQ(123, jsEngine->Evaluate("foo.responseStatus")->AsInt()); |
| EXPECT_EQ("http://example.com/\nX\nY", jsEngine->Evaluate("foo.responseText")->AsString()); |
| EXPECT_EQ("{\"Foo\":\"Bar\"}", jsEngine->Evaluate("JSON.stringify(foo.responseHeaders)")->AsString()); |
| } |
| TEST_F(MockWebRequestTest, ConnectionIsNotAllowedOnJsEngine) |
| { |
| @@ -137,17 +137,17 @@ TEST_F(MockWebRequestTest, ConnectionIsN |
| jsEngine->SetIsConnectionAllowedCallback([&isConnectionAllowedCalledTimes]()->bool |
| { |
| ++isConnectionAllowedCalledTimes; |
| return false; |
| }); |
| jsEngine->Evaluate("_webRequest.GET('http://example.com/', {X: 'Y'}, function(result) {foo = result;} )"); |
| ASSERT_TRUE(jsEngine->Evaluate("this.foo")->IsUndefined()); |
| AdblockPlus::Sleep(200); |
| - EXPECT_EQ(1u, isConnectionAllowedCalledTimes); |
| + EXPECT_EQ(1, isConnectionAllowedCalledTimes); |
| EXPECT_EQ(AdblockPlus::WebRequest::NS_ERROR_CONNECTION_REFUSED, jsEngine->Evaluate("foo.status")->AsInt()); |
| EXPECT_EQ(0, jsEngine->Evaluate("foo.responseStatus")->AsInt()); |
| EXPECT_EQ("", jsEngine->Evaluate("foo.responseText")->AsString()); |
| EXPECT_EQ("{}", jsEngine->Evaluate("JSON.stringify(foo.responseHeaders)")->AsString()); |
| } |
| namespace |
| { |