Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(844)

Unified Diff: chrome/browser/chromeos/login/owner_manager_unittest.cc

Issue 7034003: cros: Slightly more mock out-of-lining. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/owner_manager_unittest.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/owner_manager_unittest.cc
diff --git a/chrome/browser/chromeos/login/owner_manager_unittest.cc b/chrome/browser/chromeos/login/owner_manager_unittest.cc
index c41db7bfe450f817306dec620f41a6b8d41b45a6..69297b0c6ae58f3860db6c9bb0b654f86189fffd 100644
--- a/chrome/browser/chromeos/login/owner_manager_unittest.cc
+++ b/chrome/browser/chromeos/login/owner_manager_unittest.cc
@@ -28,6 +28,32 @@ using ::testing::_;
namespace chromeos {
+
+void MockKeyLoadObserver::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ LOG(INFO) << "Observed key fetch event";
+ if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) {
+ EXPECT_TRUE(success_expected_);
+ observed_ = true;
+ if (quit_on_observe_)
+ MessageLoop::current()->Quit();
+ } else if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_FAILED) {
+ EXPECT_FALSE(success_expected_);
+ observed_ = true;
+ if (quit_on_observe_)
+ MessageLoop::current()->Quit();
+ }
+}
+
+void MockKeyUser::OnKeyOpComplete(const OwnerManager::KeyOpCode return_code,
+ const std::vector<uint8>& payload) {
+ EXPECT_EQ(expected_, return_code);
+ if (quit_on_callback_)
+ MessageLoop::current()->Quit();
+}
+
+
class OwnerManagerTest : public ::testing::Test {
public:
OwnerManagerTest()
« no previous file with comments | « chrome/browser/chromeos/login/owner_manager_unittest.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698