Chromium Code Reviews| 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"); | |
|
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
| |
| 19 | |
| 20 loadURL("https://example.com/"); | |
| 21 mainResource.complete( | |
| 22 "(<script>" | |
| 23 " var socket = new WebSocket(\"ws://www.example.com/websocket\");" | |
| 24 "</script>)"); | |
| 25 | |
| 26 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.
| |
| 27 } | |
| 28 | |
| 29 } // namespace blink | |
| OLD | NEW |