| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/run_loop.h" | 5 #include "base/run_loop.h" |
| 6 #include "base/time/time.h" | 6 #include "base/time/time.h" |
| 7 #include "content/child/blink_platform_impl.h" | 7 #include "content/child/blink_platform_impl.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 // Derives BlinkPlatformImpl for testing shared timers. | 12 // Derives BlinkPlatformImpl for testing shared timers. |
| 13 class TestBlinkPlatformImpl : public BlinkPlatformImpl { | 13 class TestBlinkPlatformImpl : public BlinkPlatformImpl { |
| 14 public: | 14 public: |
| 15 TestBlinkPlatformImpl() : mock_monotonically_increasing_time_(0) {} | 15 TestBlinkPlatformImpl() : mock_monotonically_increasing_time_(0) {} |
| 16 | 16 |
| 17 // webkit_glue::BlinkPlatformImpl: | 17 // webkit_glue::BlinkPlatformImpl: |
| 18 virtual base::string16 GetLocalizedString(int) OVERRIDE { | 18 virtual base::string16 GetLocalizedString(int) OVERRIDE { |
| 19 return base::string16(); | 19 return base::string16(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 virtual base::StringPiece GetDataResource(int, ui::ScaleFactor) OVERRIDE { | 22 virtual base::StringPiece GetDataResource(int, ui::ScaleFactor) OVERRIDE { |
| 23 return base::StringPiece(); | 23 return base::StringPiece(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 virtual webkit_glue::ResourceLoaderBridge* CreateResourceLoader( | 26 virtual webkit_glue::ResourceLoaderBridge* CreateResourceLoader( |
| 27 const webkit_glue::ResourceLoaderBridge::RequestInfo&) OVERRIDE { | 27 const RequestInfo&) OVERRIDE { |
| 28 return NULL; | 28 return NULL; |
| 29 } | 29 } |
| 30 | 30 |
| 31 virtual WebSocketStreamHandleBridge* CreateWebSocketStreamBridge( | 31 virtual WebSocketStreamHandleBridge* CreateWebSocketStreamBridge( |
| 32 blink::WebSocketStreamHandle*, | 32 blink::WebSocketStreamHandle*, |
| 33 WebSocketStreamHandleDelegate*) OVERRIDE { | 33 WebSocketStreamHandleDelegate*) OVERRIDE { |
| 34 return NULL; | 34 return NULL; |
| 35 } | 35 } |
| 36 | 36 |
| 37 // Returns mock time when enabled. | 37 // Returns mock time when enabled. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 platform_impl.set_mock_monotonically_increasing_time(new_time); | 78 platform_impl.set_mock_monotonically_increasing_time(new_time); |
| 79 | 79 |
| 80 // Resume timers so that the timer set above will be set again to fire | 80 // Resume timers so that the timer set above will be set again to fire |
| 81 // immediately. | 81 // immediately. |
| 82 platform_impl.ResumeSharedTimer(); | 82 platform_impl.ResumeSharedTimer(); |
| 83 | 83 |
| 84 EXPECT_TRUE(base::TimeDelta() == platform_impl.shared_timer_delay()); | 84 EXPECT_TRUE(base::TimeDelta() == platform_impl.shared_timer_delay()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace content | 87 } // namespace content |
| OLD | NEW |