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

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

Issue 1411843008: Make blink platform time consistent with the timer virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CachingCorrectnessTest Created 5 years, 1 month 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) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 m_elapsedSeconds += seconds; 134 m_elapsedSeconds += seconds;
135 } 135 }
136 136
137 WebThread* currentThread() override 137 WebThread* currentThread() override
138 { 138 {
139 return m_platform->currentThread(); 139 return m_platform->currentThread();
140 } 140 }
141 141
142 private: 142 private:
143 // From blink::Platform: 143 // From blink::Platform:
144 virtual double currentTime() 144 double currentTimeSeconds() override
145 { 145 {
146 return kOriginalRequestDateAsDouble + m_elapsedSeconds; 146 return kOriginalRequestDateAsDouble + m_elapsedSeconds;
147 } 147 }
148 148
149 // These blink::Platform methods must be overriden to make a usable obje ct. 149 // These blink::Platform methods must be overriden to make a usable obje ct.
150 virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) { ASSERT_NOT_REACHED(); } 150 virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) { ASSERT_NOT_REACHED(); }
151 virtual const unsigned char* getTraceCategoryEnabledFlag(const char* cat egoryName) 151 virtual const unsigned char* getTraceCategoryEnabledFlag(const char* cat egoryName)
152 { 152 {
153 return &kAConstUnsignedCharZero; 153 return &kAConstUnsignedCharZero;
154 } 154 }
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 firstResource->setResponse(fresh200Response); 574 firstResource->setResponse(fresh200Response);
575 memoryCache()->add(firstResource.get()); 575 memoryCache()->add(firstResource.get());
576 576
577 advanceClock(500.); 577 advanceClock(500.);
578 578
579 ResourcePtr<Resource> fetched = fetch(); 579 ResourcePtr<Resource> fetched = fetch();
580 EXPECT_EQ(firstResource, fetched); 580 EXPECT_EQ(firstResource, fetched);
581 } 581 }
582 582
583 } // namespace blink 583 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698