| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/glue/webkit_glue.h" | 5 #include "webkit/glue/webkit_glue.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 // Derives WebKitPlatformSupportImpl for testing shared timers. | 59 // Derives WebKitPlatformSupportImpl for testing shared timers. |
| 60 class TestWebKitPlatformSupport | 60 class TestWebKitPlatformSupport |
| 61 : public webkit_glue::WebKitPlatformSupportImpl { | 61 : public webkit_glue::WebKitPlatformSupportImpl { |
| 62 public: | 62 public: |
| 63 TestWebKitPlatformSupport() : mock_monotonically_increasing_time_(0) { | 63 TestWebKitPlatformSupport() : mock_monotonically_increasing_time_(0) { |
| 64 } | 64 } |
| 65 | 65 |
| 66 // WebKitPlatformSupportImpl implementation | 66 // WebKitPlatformSupportImpl implementation |
| 67 virtual string16 GetLocalizedString(int) OVERRIDE { | 67 virtual base::string16 GetLocalizedString(int) OVERRIDE { |
| 68 return string16(); | 68 return base::string16(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 virtual base::StringPiece GetDataResource(int, ui::ScaleFactor) OVERRIDE { | 71 virtual base::StringPiece GetDataResource(int, ui::ScaleFactor) OVERRIDE { |
| 72 return base::StringPiece(); | 72 return base::StringPiece(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 virtual void GetPlugins(bool, | 75 virtual void GetPlugins(bool, |
| 76 std::vector<webkit::WebPluginInfo, | 76 std::vector<webkit::WebPluginInfo, |
| 77 std::allocator<webkit::WebPluginInfo> >*) OVERRIDE { | 77 std::allocator<webkit::WebPluginInfo> >*) OVERRIDE { |
| 78 } | 78 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Set a mock time after 1 second to simulate timers suspended for 1 second. | 127 // Set a mock time after 1 second to simulate timers suspended for 1 second. |
| 128 double new_time = base::Time::Now().ToDoubleT() + 1; | 128 double new_time = base::Time::Now().ToDoubleT() + 1; |
| 129 platform_support.set_mock_monotonically_increasing_time(new_time); | 129 platform_support.set_mock_monotonically_increasing_time(new_time); |
| 130 // Resume timers so that the timer set above will be set again to fire | 130 // Resume timers so that the timer set above will be set again to fire |
| 131 // immediately. | 131 // immediately. |
| 132 platform_support.ResumeSharedTimer(); | 132 platform_support.ResumeSharedTimer(); |
| 133 EXPECT_TRUE(base::TimeDelta() == platform_support.shared_timer_delay()); | 133 EXPECT_TRUE(base::TimeDelta() == platform_support.shared_timer_delay()); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace | 136 } // namespace |
| OLD | NEW |