| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 DummyClient() : m_called(false) {} | 63 DummyClient() : m_called(false) {} |
| 64 ~DummyClient() override {} | 64 ~DummyClient() override {} |
| 65 | 65 |
| 66 // ResourceClient implementation. | 66 // ResourceClient implementation. |
| 67 void notifyFinished(Resource* resource) override | 67 void notifyFinished(Resource* resource) override |
| 68 { | 68 { |
| 69 m_called = true; | 69 m_called = true; |
| 70 } | 70 } |
| 71 String debugName() const override { return "DummyClient"; } | 71 String debugName() const override { return "DummyClient"; } |
| 72 | 72 |
| 73 void dataReceived(Resource*, const char* data, unsigned length) override | 73 void dataReceived(Resource*, const char* data, size_t length) override |
| 74 { | 74 { |
| 75 m_data.append(data, length); | 75 m_data.append(data, length); |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool called() { return m_called; } | 78 bool called() { return m_called; } |
| 79 const Vector<char>& data() { return m_data; } | 79 const Vector<char>& data() { return m_data; } |
| 80 private: | 80 private: |
| 81 bool m_called; | 81 bool m_called; |
| 82 Vector<char> m_data; | 82 Vector<char> m_data; |
| 83 }; | 83 }; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 OwnPtr<DummyClient> dummyClient = adoptPtr(new DummyClient()); | 227 OwnPtr<DummyClient> dummyClient = adoptPtr(new DummyClient()); |
| 228 OwnPtr<RemovingClient> removingClient = adoptPtr(new RemovingClient(dummyCli
ent.get())); | 228 OwnPtr<RemovingClient> removingClient = adoptPtr(new RemovingClient(dummyCli
ent.get())); |
| 229 raw->addClient(dummyClient.get()); | 229 raw->addClient(dummyClient.get()); |
| 230 raw->addClient(removingClient.get()); | 230 raw->addClient(removingClient.get()); |
| 231 testing::runPendingTasks(); | 231 testing::runPendingTasks(); |
| 232 EXPECT_FALSE(raw->hasClients()); | 232 EXPECT_FALSE(raw->hasClients()); |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace blink | 235 } // namespace blink |
| OLD | NEW |