| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code if governed by a BSD-style license that can be |
| 3 // found in LICENSE file. |
| 4 |
| 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 #include "third_party/WebKit/public/platform/WebViewScheduler.h" |
| 7 #include "web/WebViewImpl.h" |
| 8 #include "web/tests/sim/SimRequest.h" |
| 9 #include "web/tests/sim/SimTest.h" |
| 10 |
| 11 using testing::_; |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class ActiveConnectionThrottlingTest : public SimTest {}; |
| 16 |
| 17 TEST_F(ActiveConnectionThrottlingTest, WebSocketStopsThrottling) { |
| 18 SimRequest mainResource("https://example.com/", "text/html"); |
| 19 |
| 20 loadURL("https://example.com/"); |
| 21 |
| 22 EXPECT_FALSE(webView().scheduler()->hasActiveConnectionForTest()); |
| 23 |
| 24 mainResource.complete( |
| 25 "(<script>" |
| 26 " var socket = new WebSocket(\"ws://www.example.com/websocket\");" |
| 27 "</script>)"); |
| 28 |
| 29 EXPECT_TRUE(webView().scheduler()->hasActiveConnectionForTest()); |
| 30 } |
| 31 |
| 32 } // namespace blink |
| OLD | NEW |