| 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 "base/test/simple_test_clock.h" | 7 #include "base/test/simple_test_clock.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/api/alarms/alarm_manager.h" | 9 #include "chrome/browser/extensions/api/alarms/alarm_manager.h" |
| 10 #include "chrome/browser/extensions/api/alarms/alarms_api.h" | 10 #include "chrome/browser/extensions/api/alarms/alarms_api.h" |
| 11 #include "chrome/browser/extensions/extension_function_test_utils.h" | 11 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 15 #include "chrome/common/extensions/background_info.h" | |
| 16 #include "chrome/common/extensions/extension_messages.h" | 15 #include "chrome/common/extensions/extension_messages.h" |
| 17 #include "chrome/test/base/browser_with_test_window_test.h" | 16 #include "chrome/test/base/browser_with_test_window_test.h" |
| 18 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 19 #include "content/public/test/mock_render_process_host.h" | 18 #include "content/public/test/mock_render_process_host.h" |
| 19 #include "extensions/common/manifest_handlers/background_info.h" |
| 20 #include "ipc/ipc_test_sink.h" | 20 #include "ipc/ipc_test_sink.h" |
| 21 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 23 |
| 24 typedef extensions::api::alarms::Alarm JsAlarm; | 24 typedef extensions::api::alarms::Alarm JsAlarm; |
| 25 | 25 |
| 26 namespace utils = extension_function_test_utils; | 26 namespace utils = extension_function_test_utils; |
| 27 | 27 |
| 28 namespace extensions { | 28 namespace extensions { |
| 29 | 29 |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 // In released extensions, we set the granularity to at least 1 | 610 // In released extensions, we set the granularity to at least 1 |
| 611 // minute, which makes scheduler set it to 1 minute, rather than | 611 // minute, which makes scheduler set it to 1 minute, rather than |
| 612 // 1 second later (when b is supposed to go off). | 612 // 1 second later (when b is supposed to go off). |
| 613 alarm_manager_->ScheduleNextPoll(); | 613 alarm_manager_->ScheduleNextPoll(); |
| 614 EXPECT_DOUBLE_EQ((alarm_manager_->last_poll_time_ + | 614 EXPECT_DOUBLE_EQ((alarm_manager_->last_poll_time_ + |
| 615 base::TimeDelta::FromMinutes(1)).ToJsTime(), | 615 base::TimeDelta::FromMinutes(1)).ToJsTime(), |
| 616 alarm_manager_->test_next_poll_time_.ToJsTime()); | 616 alarm_manager_->test_next_poll_time_.ToJsTime()); |
| 617 } | 617 } |
| 618 | 618 |
| 619 } // namespace extensions | 619 } // namespace extensions |
| OLD | NEW |