Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp

Issue 2123783002: Expose RunsTasksOnCurrentThread through WebTaskRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@00_fix_thread_affinity
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "wtf/PtrUtil.h" 49 #include "wtf/PtrUtil.h"
50 #include <memory> 50 #include <memory>
51 51
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 bool runsTasksOnCurrentThread() override { return true; }
59 WebTaskRunner* clone() override { return nullptr; } 60 WebTaskRunner* clone() override { return nullptr; }
60 double virtualTimeSeconds() const override { return 0.0; } 61 double virtualTimeSeconds() const override { return 0.0; }
61 double monotonicallyIncreasingVirtualTimeSeconds() const override { return 0 .0; } 62 double monotonicallyIncreasingVirtualTimeSeconds() const override { return 0 .0; }
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()
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698