| 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 "extensions/browser/api/idle/idle_api.h" | 5 #include "extensions/browser/api/idle/idle_api.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "extensions/browser/api/idle/idle_api_constants.h" | 12 #include "extensions/browser/api/idle/idle_api_constants.h" |
| 13 #include "extensions/browser/api/idle/idle_manager_factory.h" | 13 #include "extensions/browser/api/idle/idle_manager_factory.h" |
| 14 #include "extensions/browser/api/idle/idle_manager.h" | 14 #include "extensions/browser/api/idle/idle_manager.h" |
| 15 #include "extensions/browser/api_unittest.h" | 15 #include "extensions/browser/api_unittest.h" |
| 16 #include "extensions/browser/event_router.h" | 16 #include "extensions/browser/event_router.h" |
| 17 #include "extensions/browser/extension_registry.h" | 17 #include "extensions/browser/extension_registry.h" |
| 18 #include "extensions/common/api/idle.h" | 18 #include "extensions/common/api/idle.h" |
| 19 #include "extensions/common/extension.h" | 19 #include "extensions/common/extension.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 22 |
| 23 using ::testing::_; | 23 using ::testing::_; |
| 24 | 24 |
| 25 namespace idle = extensions::core_api::idle; | 25 namespace idle = extensions::api::idle; |
| 26 | 26 |
| 27 namespace extensions { | 27 namespace extensions { |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 class MockEventDelegate : public IdleManager::EventDelegate { | 31 class MockEventDelegate : public IdleManager::EventDelegate { |
| 32 public: | 32 public: |
| 33 MockEventDelegate() {} | 33 MockEventDelegate() {} |
| 34 virtual ~MockEventDelegate() {} | 34 virtual ~MockEventDelegate() {} |
| 35 MOCK_METHOD2(OnStateChanged, void(const std::string&, ui::IdleState)); | 35 MOCK_METHOD2(OnStateChanged, void(const std::string&, ui::IdleState)); |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 | 547 |
| 548 { | 548 { |
| 549 // Nothing should have fired, the listener wasn't added until afterward. | 549 // Nothing should have fired, the listener wasn't added until afterward. |
| 550 ScopedListen listen(idle_manager_, "test"); | 550 ScopedListen listen(idle_manager_, "test"); |
| 551 idle_manager_->UpdateIdleState(); | 551 idle_manager_->UpdateIdleState(); |
| 552 testing::Mock::VerifyAndClearExpectations(event_delegate_); | 552 testing::Mock::VerifyAndClearExpectations(event_delegate_); |
| 553 } | 553 } |
| 554 } | 554 } |
| 555 | 555 |
| 556 } // namespace extensions | 556 } // namespace extensions |
| OLD | NEW |