| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 ResourceLoaderBridge* bridge_; | 147 ResourceLoaderBridge* bridge_; |
| 148 | 148 |
| 149 DISALLOW_COPY_AND_ASSIGN(TestRequestPeer); | 149 DISALLOW_COPY_AND_ASSIGN(TestRequestPeer); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 // Sets up the message sender override for the unit test. | 152 // Sets up the message sender override for the unit test. |
| 153 class ResourceDispatcherTest : public testing::Test, public IPC::Sender { | 153 class ResourceDispatcherTest : public testing::Test, public IPC::Sender { |
| 154 public: | 154 public: |
| 155 ResourceDispatcherTest() : dispatcher_(this) {} | 155 ResourceDispatcherTest() : dispatcher_(this) {} |
| 156 | 156 |
| 157 virtual ~ResourceDispatcherTest() { | 157 ~ResourceDispatcherTest() override { |
| 158 STLDeleteContainerPairSecondPointers(shared_memory_map_.begin(), | 158 STLDeleteContainerPairSecondPointers(shared_memory_map_.begin(), |
| 159 shared_memory_map_.end()); | 159 shared_memory_map_.end()); |
| 160 } | 160 } |
| 161 | 161 |
| 162 // Emulates IPC send operations (IPC::Sender) by adding | 162 // Emulates IPC send operations (IPC::Sender) by adding |
| 163 // pending messages to the queue. | 163 // pending messages to the queue. |
| 164 bool Send(IPC::Message* msg) override { | 164 bool Send(IPC::Message* msg) override { |
| 165 message_queue_.push_back(IPC::Message(*msg)); | 165 message_queue_.push_back(IPC::Message(*msg)); |
| 166 delete msg; | 166 delete msg; |
| 167 return true; | 167 return true; |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 ResourceResponseHead response_head; | 781 ResourceResponseHead response_head; |
| 782 | 782 |
| 783 PerformTest(response_head); | 783 PerformTest(response_head); |
| 784 | 784 |
| 785 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 785 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
| 786 EXPECT_EQ(base::TimeTicks(), | 786 EXPECT_EQ(base::TimeTicks(), |
| 787 response_info().load_timing.connect_timing.dns_start); | 787 response_info().load_timing.connect_timing.dns_start); |
| 788 } | 788 } |
| 789 | 789 |
| 790 } // namespace content | 790 } // namespace content |
| OLD | NEW |