| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/websockets/websocket_stream.h" | 5 #include "net/websockets/websocket_stream.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 public: | 401 public: |
| 402 // This enum should match with the enum in Delegate in websocket_stream.cc. | 402 // This enum should match with the enum in Delegate in websocket_stream.cc. |
| 403 enum HandshakeResult { | 403 enum HandshakeResult { |
| 404 INCOMPLETE, | 404 INCOMPLETE, |
| 405 CONNECTED, | 405 CONNECTED, |
| 406 FAILED, | 406 FAILED, |
| 407 NUM_HANDSHAKE_RESULT_TYPES, | 407 NUM_HANDSHAKE_RESULT_TYPES, |
| 408 }; | 408 }; |
| 409 | 409 |
| 410 class StreamCreation : public WebSocketStreamCreateTest { | 410 class StreamCreation : public WebSocketStreamCreateTest { |
| 411 virtual void TestBody() override {} | 411 void TestBody() override {} |
| 412 }; | 412 }; |
| 413 | 413 |
| 414 scoped_ptr<base::HistogramSamples> GetSamples(const std::string& name) { | 414 scoped_ptr<base::HistogramSamples> GetSamples(const std::string& name) { |
| 415 base::HistogramBase* histogram = | 415 base::HistogramBase* histogram = |
| 416 base::StatisticsRecorder::FindHistogram(name); | 416 base::StatisticsRecorder::FindHistogram(name); |
| 417 return histogram ? histogram->SnapshotSamples() | 417 return histogram ? histogram->SnapshotSamples() |
| 418 : scoped_ptr<base::HistogramSamples>(); | 418 : scoped_ptr<base::HistogramSamples>(); |
| 419 } | 419 } |
| 420 }; | 420 }; |
| 421 | 421 |
| (...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 if (original) { | 1453 if (original) { |
| 1454 samples->Subtract(*original); // Cancel the original values. | 1454 samples->Subtract(*original); // Cancel the original values. |
| 1455 } | 1455 } |
| 1456 EXPECT_EQ(1, samples->GetCount(INCOMPLETE)); | 1456 EXPECT_EQ(1, samples->GetCount(INCOMPLETE)); |
| 1457 EXPECT_EQ(0, samples->GetCount(CONNECTED)); | 1457 EXPECT_EQ(0, samples->GetCount(CONNECTED)); |
| 1458 EXPECT_EQ(0, samples->GetCount(FAILED)); | 1458 EXPECT_EQ(0, samples->GetCount(FAILED)); |
| 1459 } | 1459 } |
| 1460 | 1460 |
| 1461 } // namespace | 1461 } // namespace |
| 1462 } // namespace net | 1462 } // namespace net |
| OLD | NEW |