| 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..96488cd940e44f2ceb373d9120dada9512455a3e
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/web/tests/ActiveConnectionThrottlingTest.cpp
|
| @@ -0,0 +1,32 @@
|
| +// 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");
|
| +
|
| + loadURL("https://example.com/");
|
| +
|
| + EXPECT_FALSE(webView().scheduler()->hasActiveConnectionForTest());
|
| +
|
| + mainResource.complete(
|
| + "(<script>"
|
| + " var socket = new WebSocket(\"ws://www.example.com/websocket\");"
|
| + "</script>)");
|
| +
|
| + EXPECT_TRUE(webView().scheduler()->hasActiveConnectionForTest());
|
| +}
|
| +
|
| +} // namespace blink
|
|
|