| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 testing::runPendingTasks(); | 350 testing::runPendingTasks(); |
| 351 raw->removeClient(addingClient); | 351 raw->removeClient(addingClient); |
| 352 EXPECT_FALSE(dummyClient->called()); | 352 EXPECT_FALSE(dummyClient->called()); |
| 353 EXPECT_FALSE(raw->isAlive()); | 353 EXPECT_FALSE(raw->isAlive()); |
| 354 } | 354 } |
| 355 | 355 |
| 356 // This client removes another client when notified. | 356 // This client removes another client when notified. |
| 357 class RemovingClient : public GarbageCollectedFinalized<RemovingClient>, public
RawResourceClient { | 357 class RemovingClient : public GarbageCollectedFinalized<RemovingClient>, public
RawResourceClient { |
| 358 USING_GARBAGE_COLLECTED_MIXIN(RemovingClient); | 358 USING_GARBAGE_COLLECTED_MIXIN(RemovingClient); |
| 359 public: | 359 public: |
| 360 RemovingClient(DummyClient* client) | 360 explicit RemovingClient(DummyClient* client) |
| 361 : m_dummyClient(client) {} | 361 : m_dummyClient(client) {} |
| 362 | 362 |
| 363 ~RemovingClient() override {} | 363 ~RemovingClient() override {} |
| 364 | 364 |
| 365 // ResourceClient implementation. | 365 // ResourceClient implementation. |
| 366 void notifyFinished(Resource* resource) override | 366 void notifyFinished(Resource* resource) override |
| 367 { | 367 { |
| 368 resource->removeClient(m_dummyClient); | 368 resource->removeClient(m_dummyClient); |
| 369 resource->removeClient(this); | 369 resource->removeClient(this); |
| 370 } | 370 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 400 | 400 |
| 401 TEST(RawResourceTest, CanReuseDevToolsEmulateNetworkConditionsClientIdHeader) | 401 TEST(RawResourceTest, CanReuseDevToolsEmulateNetworkConditionsClientIdHeader) |
| 402 { | 402 { |
| 403 ResourceRequest request("data:text/html,"); | 403 ResourceRequest request("data:text/html,"); |
| 404 request.setHTTPHeaderField(HTTPNames::X_DevTools_Emulate_Network_Conditions_
Client_Id, "Foo"); | 404 request.setHTTPHeaderField(HTTPNames::X_DevTools_Emulate_Network_Conditions_
Client_Id, "Foo"); |
| 405 Resource* raw = RawResource::create(request, Resource::Raw); | 405 Resource* raw = RawResource::create(request, Resource::Raw); |
| 406 EXPECT_TRUE(raw->canReuse(ResourceRequest("data:text/html,"))); | 406 EXPECT_TRUE(raw->canReuse(ResourceRequest("data:text/html,"))); |
| 407 } | 407 } |
| 408 | 408 |
| 409 } // namespace blink | 409 } // namespace blink |
| OLD | NEW |