forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instant Tethering: Rewrite DisconnectTetheringOperation test.
This change also factors out TestTimerFactory to reuse code. R=khorimoto@chromium.org Bug: none Test: DisconnectTetheringOperationTest.* Change-Id: I5988d6bfdbf145511d9ea5c7451c31b9d929b753 Reviewed-on: https://chromium-review.googlesource.com/c/1357614 Commit-Queue: James Hawkins <jhawkins@chromium.org> Reviewed-by: Kyle Horimoto <khorimoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#613187}
- Loading branch information
James Hawkins
authored and
Commit Bot
committed
Dec 3, 2018
1 parent
cc2560e
commit 5a6b557
Showing
7 changed files
with
185 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chromeos/components/tether/test_timer_factory.h" | ||
|
||
#include "base/logging.h" | ||
|
||
namespace chromeos { | ||
namespace tether { | ||
|
||
TestTimerFactory::TestTimerFactory() = default; | ||
TestTimerFactory::~TestTimerFactory() = default; | ||
|
||
std::unique_ptr<base::OneShotTimer> TestTimerFactory::CreateOneShotTimer() { | ||
DCHECK(!device_id_for_next_timer_.empty()); | ||
auto mock_timer = std::make_unique<base::MockOneShotTimer>(); | ||
device_id_to_timer_map_[device_id_for_next_timer_] = mock_timer.get(); | ||
return std::move(mock_timer); | ||
} | ||
|
||
} // namespace tether | ||
} // namespace chromeos |
Oops, something went wrong.