Chromium Code Reviews| Index: third_party/WebKit/Source/web/tests/ActiveConnectionThrottlingTest.cpp |
| diff --git a/third_party/WebKit/Source/web/tests/ActiveConnectionThrottlingTest.cpp b/third_party/WebKit/Source/web/tests/ActiveConnectionThrottlingTest.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c5ed972b25245d9c2fd375799fed10064dba914e |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/web/tests/ActiveConnectionThrottlingTest.cpp |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code if governed by a BSD-style license that can be |
| +// found in LICENSE file. |
| + |
| +#include "testing/gtest/include/gtest/gtest.h" |
| +#include "third_party/WebKit/public/platform/WebViewScheduler.h" |
| +#include "web/WebViewImpl.h" |
| +#include "web/tests/sim/SimRequest.h" |
| +#include "web/tests/sim/SimTest.h" |
| + |
| +using testing::_; |
| + |
| +namespace blink { |
| + |
| +class ActiveConnectionThrottlingTest : public SimTest {}; |
| + |
| +TEST_F(ActiveConnectionThrottlingTest, WebSocketStopsThrottling) { |
| + SimRequest mainResource("https://example.com/", "text/html"); |
|
Sami
2017/02/08 17:26:58
In the other tests we needed to webView().settings
altimin
2017/02/08 17:32:13
I'm not 100% sure, but it seems so. (This test fai
|
| + |
| + loadURL("https://example.com/"); |
| + mainResource.complete( |
| + "(<script>" |
| + " var socket = new WebSocket(\"ws://www.example.com/websocket\");" |
| + "</script>)"); |
| + |
| + EXPECT_TRUE(webView().scheduler()->hasActiveConnectionForTest()); |
|
Sami
2017/02/08 17:26:58
Please also check this is false before loading any
altimin
2017/02/08 17:32:13
Done.
|
| +} |
| + |
| +} // namespace blink |