| 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/renderer/extensions/extension_localization_peer.h" | 9 #include "chrome/renderer/extensions/extension_localization_peer.h" |
| 10 #include "extensions/common/message_bundle.h" | 10 #include "extensions/common/message_bundle.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 const std::string& security_info, | 72 const std::string& security_info, |
| 73 const base::TimeTicks& completion_time, | 73 const base::TimeTicks& completion_time, |
| 74 int64_t total_transfer_size)); | 74 int64_t total_transfer_size)); |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(MockRequestPeer); | 77 DISALLOW_COPY_AND_ASSIGN(MockRequestPeer); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 class ExtensionLocalizationPeerTest : public testing::Test { | 80 class ExtensionLocalizationPeerTest : public testing::Test { |
| 81 protected: | 81 protected: |
| 82 virtual void SetUp() { | 82 void SetUp() override { |
| 83 sender_.reset(new MockIpcMessageSender()); | 83 sender_.reset(new MockIpcMessageSender()); |
| 84 original_peer_.reset(new MockRequestPeer()); | 84 original_peer_.reset(new MockRequestPeer()); |
| 85 filter_peer_.reset( | 85 filter_peer_.reset( |
| 86 ExtensionLocalizationPeer::CreateExtensionLocalizationPeer( | 86 ExtensionLocalizationPeer::CreateExtensionLocalizationPeer( |
| 87 original_peer_.get(), sender_.get(), "text/css", | 87 original_peer_.get(), sender_.get(), "text/css", |
| 88 GURL(kExtensionUrl_1))); | 88 GURL(kExtensionUrl_1))); |
| 89 } | 89 } |
| 90 | 90 |
| 91 ExtensionLocalizationPeer* CreateExtensionLocalizationPeer( | 91 ExtensionLocalizationPeer* CreateExtensionLocalizationPeer( |
| 92 const std::string& mime_type, | 92 const std::string& mime_type, |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 EXPECT_CALL(*original_peer_, | 240 EXPECT_CALL(*original_peer_, |
| 241 OnReceivedData(StrEq(message.data()), message.length(), -1)); | 241 OnReceivedData(StrEq(message.data()), message.length(), -1)); |
| 242 | 242 |
| 243 EXPECT_CALL(*original_peer_, OnReceivedResponse(_)); | 243 EXPECT_CALL(*original_peer_, OnReceivedResponse(_)); |
| 244 EXPECT_CALL(*original_peer_, OnCompletedRequest( | 244 EXPECT_CALL(*original_peer_, OnCompletedRequest( |
| 245 net::OK, false, false, "", base::TimeTicks(), -1)); | 245 net::OK, false, false, "", base::TimeTicks(), -1)); |
| 246 | 246 |
| 247 filter_peer->OnCompletedRequest( | 247 filter_peer->OnCompletedRequest( |
| 248 net::OK, false, false, std::string(), base::TimeTicks(), -1); | 248 net::OK, false, false, std::string(), base::TimeTicks(), -1); |
| 249 } | 249 } |
| OLD | NEW |