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 <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/common/extensions/extension_localization_peer.h" | 9 #include "chrome/common/extensions/extension_localization_peer.h" |
10 #include "chrome/common/extensions/message_bundle.h" | 10 #include "chrome/common/extensions/message_bundle.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 static const char* const kExtensionUrl_1 = | 25 static const char* const kExtensionUrl_1 = |
26 "chrome-extension://some_id/popup.css"; | 26 "chrome-extension://some_id/popup.css"; |
27 | 27 |
28 static const char* const kExtensionUrl_2 = | 28 static const char* const kExtensionUrl_2 = |
29 "chrome-extension://some_id2/popup.css"; | 29 "chrome-extension://some_id2/popup.css"; |
30 | 30 |
31 static const char* const kExtensionUrl_3 = | 31 static const char* const kExtensionUrl_3 = |
32 "chrome-extension://some_id3/popup.css"; | 32 "chrome-extension://some_id3/popup.css"; |
33 | 33 |
34 void MessageDeleter(IPC::Message* message) { | 34 void MessageDeleter(IPC::Message* message) { |
35 delete static_cast<IPC::SyncMessage*>(message)->GetReplyDeserializer(); | |
36 delete message; | 35 delete message; |
37 } | 36 } |
38 | 37 |
39 class MockIpcMessageSender : public IPC::Sender { | 38 class MockIpcMessageSender : public IPC::Sender { |
40 public: | 39 public: |
41 MockIpcMessageSender() { | 40 MockIpcMessageSender() { |
42 ON_CALL(*this, Send(_)) | 41 ON_CALL(*this, Send(_)) |
43 .WillByDefault(DoAll(Invoke(MessageDeleter), Return(true))); | 42 .WillByDefault(DoAll(Invoke(MessageDeleter), Return(true))); |
44 } | 43 } |
45 | 44 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // __MSG_missing_message__ is missing, so message stays the same. | 236 // __MSG_missing_message__ is missing, so message stays the same. |
238 EXPECT_CALL(*original_peer_, | 237 EXPECT_CALL(*original_peer_, |
239 OnReceivedData(StrEq(message.data()), message.length(), -1)); | 238 OnReceivedData(StrEq(message.data()), message.length(), -1)); |
240 | 239 |
241 EXPECT_CALL(*original_peer_, OnReceivedResponse(_)); | 240 EXPECT_CALL(*original_peer_, OnReceivedResponse(_)); |
242 EXPECT_CALL(*original_peer_, OnCompletedRequest( | 241 EXPECT_CALL(*original_peer_, OnCompletedRequest( |
243 net::OK, false, "", base::TimeTicks())); | 242 net::OK, false, "", base::TimeTicks())); |
244 | 243 |
245 filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks()); | 244 filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks()); |
246 } | 245 } |
OLD | NEW |