| 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 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 ScopedListen::~ScopedListen() { | 111 ScopedListen::~ScopedListen() { |
| 112 const EventListenerInfo details(idle::OnStateChanged::kEventName, | 112 const EventListenerInfo details(idle::OnStateChanged::kEventName, |
| 113 extension_id_, GURL(), NULL); | 113 extension_id_, GURL(), NULL); |
| 114 idle_manager_->OnListenerRemoved(details); | 114 idle_manager_->OnListenerRemoved(details); |
| 115 } | 115 } |
| 116 | 116 |
| 117 std::unique_ptr<KeyedService> IdleManagerTestFactory( | 117 std::unique_ptr<KeyedService> IdleManagerTestFactory( |
| 118 content::BrowserContext* context) { | 118 content::BrowserContext* context) { |
| 119 return base::WrapUnique(new IdleManager(context)); | 119 return base::MakeUnique<IdleManager>(context); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace | 122 } // namespace |
| 123 | 123 |
| 124 class IdleTest : public ApiUnitTest { | 124 class IdleTest : public ApiUnitTest { |
| 125 public: | 125 public: |
| 126 void SetUp() override; | 126 void SetUp() override; |
| 127 | 127 |
| 128 protected: | 128 protected: |
| 129 IdleManager* idle_manager_; | 129 IdleManager* idle_manager_; |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 549 |
| 550 { | 550 { |
| 551 // Nothing should have fired, the listener wasn't added until afterward. | 551 // Nothing should have fired, the listener wasn't added until afterward. |
| 552 ScopedListen listen(idle_manager_, "test"); | 552 ScopedListen listen(idle_manager_, "test"); |
| 553 idle_manager_->UpdateIdleState(); | 553 idle_manager_->UpdateIdleState(); |
| 554 testing::Mock::VerifyAndClearExpectations(event_delegate_); | 554 testing::Mock::VerifyAndClearExpectations(event_delegate_); |
| 555 } | 555 } |
| 556 } | 556 } |
| 557 | 557 |
| 558 } // namespace extensions | 558 } // namespace extensions |
| OLD | NEW |