Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: net/websockets/websocket_frame_perftest.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/websockets/websocket_frame_parser_test.cc ('k') | net/websockets/websocket_frame_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_frame_perftest.cc
diff --git a/net/websockets/websocket_frame_perftest.cc b/net/websockets/websocket_frame_perftest.cc
deleted file mode 100644
index 98ea624ac145036b4cc588ac5dd3bfd9f74a6566..0000000000000000000000000000000000000000
--- a/net/websockets/websocket_frame_perftest.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/websockets/websocket_frame.h"
-
-#include <algorithm>
-#include <vector>
-
-#include "base/macros.h"
-#include "base/test/perf_time_logger.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace net {
-
-namespace {
-
-const int kIterations = 100000;
-const int kLongPayloadSize = 1 << 16;
-const char kMaskingKey[] = "\xFE\xED\xBE\xEF";
-
-static_assert(arraysize(kMaskingKey) ==
- WebSocketFrameHeader::kMaskingKeyLength + 1,
- "incorrect masking key size");
-
-class WebSocketFrameTestMaskBenchmark : public ::testing::Test {
- protected:
- void Benchmark(const char* const name,
- const char* const payload,
- size_t size) {
- std::vector<char> scratch(payload, payload + size);
- WebSocketMaskingKey masking_key;
- std::copy(kMaskingKey,
- kMaskingKey + WebSocketFrameHeader::kMaskingKeyLength,
- masking_key.key);
- base::PerfTimeLogger timer(name);
- for (int x = 0; x < kIterations; ++x) {
- MaskWebSocketFramePayload(
- masking_key, x % size, &scratch.front(), scratch.size());
- }
- timer.Done();
- }
-};
-
-TEST_F(WebSocketFrameTestMaskBenchmark, BenchmarkMaskShortPayload) {
- static const char kShortPayload[] = "Short Payload";
- Benchmark(
- "Frame_mask_short_payload", kShortPayload, arraysize(kShortPayload));
-}
-
-TEST_F(WebSocketFrameTestMaskBenchmark, BenchmarkMaskLongPayload) {
- std::vector<char> payload(kLongPayloadSize, 'a');
- Benchmark("Frame_mask_long_payload", &payload.front(), payload.size());
-}
-
-} // namespace
-
-} // namespace net
« no previous file with comments | « net/websockets/websocket_frame_parser_test.cc ('k') | net/websockets/websocket_frame_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698