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

Side by Side Diff: net/quic/crypto/local_strike_register_client_test.cc

Issue 126513003: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
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/quic/crypto/local_strike_register_client.h" 5 #include "net/quic/crypto/local_strike_register_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
11 #include "base/sys_byteorder.h" 11 #include "base/sys_byteorder.h"
12 #include "net/quic/crypto/crypto_protocol.h" 12 #include "net/quic/crypto/crypto_protocol.h"
13 #include "net/quic/quic_time.h" 13 #include "net/quic/quic_time.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 using base::StringPiece; 16 using base::StringPiece;
17 using std::string; 17 using std::string;
18 18
19 namespace net { 19 namespace net {
20 namespace test { 20 namespace test {
21 namespace { 21 namespace {
22 22
23 class RecordResultCallback : public StrikeRegisterClient::ResultCallback { 23 class RecordResultCallback : public StrikeRegisterClient::ResultCallback {
24 public: 24 public:
25 // RecordResultCallback stores the argument to RunImpl in 25 // RecordResultCallback stores the argument to RunImpl in
26 // |*saved_value| and sets |*called| to true. The callback is self 26 // |*saved_value| and sets |*called| to true. The callback is self
27 // deleting. 27 // deleting.
28 RecordResultCallback(bool* called, bool* saved_value) 28 RecordResultCallback(bool* called, bool* saved_value)
29 : called_(called), saved_value_(saved_value) { 29 : called_(called),
30 saved_value_(saved_value) {
30 *called_ = false; 31 *called_ = false;
31 } 32 }
32 33
33 protected: 34 protected:
34 virtual void RunImpl(bool nonce_is_valid_and_unique) OVERRIDE { 35 virtual void RunImpl(bool nonce_is_valid_and_unique) OVERRIDE {
35 *called_ = true; 36 *called_ = true;
36 *saved_value_ = nonce_is_valid_and_unique; 37 *saved_value_ = nonce_is_valid_and_unique;
37 } 38 }
38 39
39 private: 40 private:
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 QuicWallTime::FromUNIXSeconds(kCurrentTimeExternalSecs), 117 QuicWallTime::FromUNIXSeconds(kCurrentTimeExternalSecs),
117 new RecordResultCallback(&called, &is_valid)); 118 new RecordResultCallback(&called, &is_valid));
118 EXPECT_TRUE(called); 119 EXPECT_TRUE(called);
119 EXPECT_TRUE(is_valid); 120 EXPECT_TRUE(is_valid);
120 } 121 }
121 } 122 }
122 123
123 } // namespace 124 } // namespace
124 } // namespace test 125 } // namespace test
125 } // namespace net 126 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender_test.cc ('k') | net/quic/crypto/quic_crypto_server_config_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698