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

Side by Side Diff: net/websockets/websocket_frame_test.cc

Issue 296513013: Cleanup: Use base::CommandLine in net/ (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/tools/tld_cleanup/tld_cleanup.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_frame.h" 5 #include "net/websockets/websocket_frame.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 341 }
342 } 342 }
343 } 343 }
344 344
345 class WebSocketFrameTestMaskBenchmark : public testing::Test { 345 class WebSocketFrameTestMaskBenchmark : public testing::Test {
346 public: 346 public:
347 WebSocketFrameTestMaskBenchmark() : iterations_(kDefaultIterations) {} 347 WebSocketFrameTestMaskBenchmark() : iterations_(kDefaultIterations) {}
348 348
349 virtual void SetUp() { 349 virtual void SetUp() {
350 std::string iterations( 350 std::string iterations(
351 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 351 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
352 kBenchmarkIterations)); 352 kBenchmarkIterations));
353 int benchmark_iterations = 0; 353 int benchmark_iterations = 0;
354 if (!iterations.empty() && 354 if (!iterations.empty() &&
355 base::StringToInt(iterations, &benchmark_iterations)) { 355 base::StringToInt(iterations, &benchmark_iterations)) {
356 iterations_ = benchmark_iterations; 356 iterations_ = benchmark_iterations;
357 } 357 }
358 } 358 }
359 359
360 void Benchmark(const char* const payload, size_t size) { 360 void Benchmark(const char* const payload, size_t size) {
361 std::vector<char> scratch(payload, payload + size); 361 std::vector<char> scratch(payload, payload + size);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 // Check that opcodes with the 4 bit set return false 453 // Check that opcodes with the 4 bit set return false
454 EXPECT_FALSE(Frame::IsKnownControlOpCode(0x6)); 454 EXPECT_FALSE(Frame::IsKnownControlOpCode(0x6));
455 EXPECT_FALSE(Frame::IsKnownControlOpCode(0xF)); 455 EXPECT_FALSE(Frame::IsKnownControlOpCode(0xF));
456 456
457 // Check that out-of-range opcodes return false 457 // Check that out-of-range opcodes return false
458 EXPECT_FALSE(Frame::IsKnownControlOpCode(-1)); 458 EXPECT_FALSE(Frame::IsKnownControlOpCode(-1));
459 EXPECT_FALSE(Frame::IsKnownControlOpCode(0xFF)); 459 EXPECT_FALSE(Frame::IsKnownControlOpCode(0xFF));
460 } 460 }
461 461
462 } // namespace net 462 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/tld_cleanup/tld_cleanup.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698