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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 memoryCache()->remove(resource.get()); | 166 memoryCache()->remove(resource.get()); |
167 | 167 |
168 resource->removeClient(client.get()); | 168 resource->removeClient(client.get()); |
169 EXPECT_FALSE(resource->hasClientsOrObservers()); | 169 EXPECT_FALSE(resource->hasClientsOrObservers()); |
170 EXPECT_FALSE(client->called()); | 170 EXPECT_FALSE(client->called()); |
171 EXPECT_EQ(0u, client->data().size()); | 171 EXPECT_EQ(0u, client->data().size()); |
172 } | 172 } |
173 | 173 |
174 TEST(RawResourceTest, RevalidationSucceededUpdateHeaders) | 174 TEST(RawResourceTest, RevalidationSucceededUpdateHeaders) |
175 { | 175 { |
176 RefPtrWillBeRawPtr<Resource> resource = RawResource::create(ResourceRequest(
"data:text/html,"), Resource::Raw); | 176 RawPtr<Resource> resource = RawResource::create(ResourceRequest("data:text/h
tml,"), Resource::Raw); |
177 ResourceResponse response; | 177 ResourceResponse response; |
178 response.setHTTPStatusCode(200); | 178 response.setHTTPStatusCode(200); |
179 response.addHTTPHeaderField("keep-alive", "keep-alive value"); | 179 response.addHTTPHeaderField("keep-alive", "keep-alive value"); |
180 response.addHTTPHeaderField("expires", "expires value"); | 180 response.addHTTPHeaderField("expires", "expires value"); |
181 response.addHTTPHeaderField("last-modified", "last-modified value"); | 181 response.addHTTPHeaderField("last-modified", "last-modified value"); |
182 response.addHTTPHeaderField("proxy-authenticate", "proxy-authenticate value"
); | 182 response.addHTTPHeaderField("proxy-authenticate", "proxy-authenticate value"
); |
183 response.addHTTPHeaderField("proxy-connection", "proxy-connection value"); | 183 response.addHTTPHeaderField("proxy-connection", "proxy-connection value"); |
184 response.addHTTPHeaderField("x-custom", "custom value"); | 184 response.addHTTPHeaderField("x-custom", "custom value"); |
185 resource->responseReceived(response, nullptr); | 185 resource->responseReceived(response, nullptr); |
186 resource->finish(); | 186 resource->finish(); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 OwnPtr<DummyClient> dummyClient = adoptPtr(new DummyClient()); | 287 OwnPtr<DummyClient> dummyClient = adoptPtr(new DummyClient()); |
288 OwnPtr<RemovingClient> removingClient = adoptPtr(new RemovingClient(dummyCli
ent.get())); | 288 OwnPtr<RemovingClient> removingClient = adoptPtr(new RemovingClient(dummyCli
ent.get())); |
289 raw->addClient(dummyClient.get()); | 289 raw->addClient(dummyClient.get()); |
290 raw->addClient(removingClient.get()); | 290 raw->addClient(removingClient.get()); |
291 testing::runPendingTasks(); | 291 testing::runPendingTasks(); |
292 EXPECT_FALSE(raw->hasClientsOrObservers()); | 292 EXPECT_FALSE(raw->hasClientsOrObservers()); |
293 } | 293 } |
294 | 294 |
295 } // namespace blink | 295 } // namespace blink |
OLD | NEW |