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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const char testImageFilename[] = "white-1x1.png"; | 62 const char testImageFilename[] = "white-1x1.png"; |
63 const int testImageSize = 103; // size of web/tests/data/white-1x1.png | 63 const int testImageSize = 103; // size of web/tests/data/white-1x1.png |
64 | 64 |
65 class MockTaskRunner : public blink::WebTaskRunner { | 65 class MockTaskRunner : public blink::WebTaskRunner { |
66 void postTask(const WebTraceLocation&, Task*) override { } | 66 void postTask(const WebTraceLocation&, Task*) override { } |
67 void postDelayedTask(const WebTraceLocation&, Task*, double) override { } | 67 void postDelayedTask(const WebTraceLocation&, Task*, double) override { } |
68 bool runsTasksOnCurrentThread() override { return true; } | 68 bool runsTasksOnCurrentThread() override { return true; } |
69 std::unique_ptr<WebTaskRunner> clone() override { return nullptr; } | 69 std::unique_ptr<WebTaskRunner> clone() override { return nullptr; } |
70 double virtualTimeSeconds() const override { return 0.0; } | 70 double virtualTimeSeconds() const override { return 0.0; } |
71 double monotonicallyIncreasingVirtualTimeSeconds() const override { return 0
.0; } | 71 double monotonicallyIncreasingVirtualTimeSeconds() const override { return 0
.0; } |
| 72 SingleThreadTaskRunner* taskRunner() override { return nullptr; } |
72 }; | 73 }; |
73 | 74 |
74 } | 75 } |
75 | 76 |
76 class ResourceFetcherTestMockFetchContext : public FetchContext { | 77 class ResourceFetcherTestMockFetchContext : public FetchContext { |
77 public: | 78 public: |
78 static ResourceFetcherTestMockFetchContext* create() | 79 static ResourceFetcherTestMockFetchContext* create() |
79 { | 80 { |
80 return new ResourceFetcherTestMockFetchContext; | 81 return new ResourceFetcherTestMockFetchContext; |
81 } | 82 } |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 requester.registerRedirect(redirectURL1, redirectURL2); | 497 requester.registerRedirect(redirectURL1, redirectURL2); |
497 requester.registerRedirect(redirectURL2, redirectURL3); | 498 requester.registerRedirect(redirectURL2, redirectURL3); |
498 requester.registerRedirect(redirectURL3, finalURL); | 499 requester.registerRedirect(redirectURL3, finalURL); |
499 requester.registerFinalResource(finalURL); | 500 requester.registerFinalResource(finalURL); |
500 requester.request(redirectURL1); | 501 requester.request(redirectURL1); |
501 | 502 |
502 EXPECT_EQ(testImageSize, requester.context()->getTransferSize()); | 503 EXPECT_EQ(testImageSize, requester.context()->getTransferSize()); |
503 } | 504 } |
504 | 505 |
505 } // namespace blink | 506 } // namespace blink |
OLD | NEW |