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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 namespace blink { | 52 namespace blink { |
53 | 53 |
54 namespace { | 54 namespace { |
55 | 55 |
56 class MockTaskRunner : public blink::WebTaskRunner { | 56 class MockTaskRunner : public blink::WebTaskRunner { |
57 void postTask(const WebTraceLocation&, Task*) override { } | 57 void postTask(const WebTraceLocation&, Task*) override { } |
58 void postDelayedTask(const WebTraceLocation&, Task*, double) override { } | 58 void postDelayedTask(const WebTraceLocation&, Task*, double) override { } |
59 WebTaskRunner* clone() override { return nullptr; } | 59 WebTaskRunner* clone() override { return nullptr; } |
60 double virtualTimeSeconds() const override { return 0.0; } | 60 double virtualTimeSeconds() const override { return 0.0; } |
61 double monotonicallyIncreasingVirtualTimeSeconds() const override { return 0 .0; } | 61 double monotonicallyIncreasingVirtualTimeSeconds() const override { return 0 .0; } |
62 scoped_refptr<base::SingleThreadTaskRunner> taskRunner() override { return n ullptr; } | |
esprehn
2016/07/22 06:12:11
you can't use scoped_refptr in core/, this would n
Sami
2016/07/29 17:03:27
Turns out it's not needed: I've now made it a raw
| |
62 }; | 63 }; |
63 | 64 |
64 } | 65 } |
65 | 66 |
66 class ResourceFetcherTestMockFetchContext : public FetchContext { | 67 class ResourceFetcherTestMockFetchContext : public FetchContext { |
67 public: | 68 public: |
68 static ResourceFetcherTestMockFetchContext* create() | 69 static ResourceFetcherTestMockFetchContext* create() |
69 { | 70 { |
70 return new ResourceFetcherTestMockFetchContext; | 71 return new ResourceFetcherTestMockFetchContext; |
71 } | 72 } |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
385 FetchRequest fetchRequest = FetchRequest(url, FetchInitiatorInfo()); | 386 FetchRequest fetchRequest = FetchRequest(url, FetchInitiatorInfo()); |
386 Resource* resource = fetcher->requestResource(fetchRequest, TestResourceFact ory(Resource::Raw)); | 387 Resource* resource = fetcher->requestResource(fetchRequest, TestResourceFact ory(Resource::Raw)); |
387 Persistent<ServeRequestsOnCompleteClient> client = new ServeRequestsOnComple teClient(); | 388 Persistent<ServeRequestsOnCompleteClient> client = new ServeRequestsOnComple teClient(); |
388 resource->addClient(client); | 389 resource->addClient(client); |
389 resource->loader()->cancel(); | 390 resource->loader()->cancel(); |
390 resource->removeClient(client); | 391 resource->removeClient(client); |
391 Platform::current()->getURLLoaderMockFactory()->unregisterURL(url); | 392 Platform::current()->getURLLoaderMockFactory()->unregisterURL(url); |
392 } | 393 } |
393 | 394 |
394 } // namespace blink | 395 } // namespace blink |
OLD | NEW |