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 // This file tests the chrome.alarms extension API. | 5 // This file tests the chrome.alarms extension API. |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/test/simple_test_clock.h" | 9 #include "base/test/simple_test_clock.h" |
8 #include "base/values.h" | 10 #include "base/values.h" |
9 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
10 #include "content/public/test/mock_render_process_host.h" | 12 #include "content/public/test/mock_render_process_host.h" |
11 #include "extensions/browser/api/alarms/alarm_manager.h" | 13 #include "extensions/browser/api/alarms/alarm_manager.h" |
12 #include "extensions/browser/api/alarms/alarms_api.h" | 14 #include "extensions/browser/api/alarms/alarms_api.h" |
13 #include "extensions/browser/api_test_utils.h" | 15 #include "extensions/browser/api_test_utils.h" |
14 #include "extensions/browser/api_unittest.h" | 16 #include "extensions/browser/api_unittest.h" |
15 #include "extensions/common/extension_messages.h" | 17 #include "extensions/common/extension_messages.h" |
16 #include "ipc/ipc_test_sink.h" | 18 #include "ipc/ipc_test_sink.h" |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 | 691 |
690 // The next poll should be the first poll that hasn't happened and is in-line | 692 // The next poll should be the first poll that hasn't happened and is in-line |
691 // with the original scheduling. | 693 // with the original scheduling. |
692 // Last poll was at 380 seconds; next poll should be at 480 seconds. | 694 // Last poll was at 380 seconds; next poll should be at 480 seconds. |
693 EXPECT_DOUBLE_EQ((alarm_manager_->last_poll_time_ + | 695 EXPECT_DOUBLE_EQ((alarm_manager_->last_poll_time_ + |
694 base::TimeDelta::FromSeconds(100)).ToJsTime(), | 696 base::TimeDelta::FromSeconds(100)).ToJsTime(), |
695 alarm_manager_->next_poll_time_.ToJsTime()); | 697 alarm_manager_->next_poll_time_.ToJsTime()); |
696 } | 698 } |
697 | 699 |
698 } // namespace extensions | 700 } // namespace extensions |
OLD | NEW |