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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 namespace { | 60 namespace { |
61 | 61 |
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 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 }; | 72 }; |
73 | 73 |
74 } | 74 } |
75 | 75 |
76 class ResourceFetcherTestMockFetchContext : public FetchContext { | 76 class ResourceFetcherTestMockFetchContext : public FetchContext { |
77 public: | 77 public: |
78 static ResourceFetcherTestMockFetchContext* create() | 78 static ResourceFetcherTestMockFetchContext* create() |
79 { | 79 { |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 requester.registerRedirect(redirectURL1, redirectURL2); | 496 requester.registerRedirect(redirectURL1, redirectURL2); |
497 requester.registerRedirect(redirectURL2, redirectURL3); | 497 requester.registerRedirect(redirectURL2, redirectURL3); |
498 requester.registerRedirect(redirectURL3, finalURL); | 498 requester.registerRedirect(redirectURL3, finalURL); |
499 requester.registerFinalResource(finalURL); | 499 requester.registerFinalResource(finalURL); |
500 requester.request(redirectURL1); | 500 requester.request(redirectURL1); |
501 | 501 |
502 EXPECT_EQ(testImageSize, requester.context()->getTransferSize()); | 502 EXPECT_EQ(testImageSize, requester.context()->getTransferSize()); |
503 } | 503 } |
504 | 504 |
505 } // namespace blink | 505 } // namespace blink |
OLD | NEW |