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

Unified Diff: chrome/browser/policy/device_token_fetcher_unittest.cc

Issue 4967005: No persisted device id/token for unmanaged devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
Index: chrome/browser/policy/device_token_fetcher_unittest.cc
diff --git a/chrome/browser/policy/device_token_fetcher_unittest.cc b/chrome/browser/policy/device_token_fetcher_unittest.cc
index b6f50e539b648b229aeaa1fc58618bfddc94f434..0504a499ae8979c54c21d82034c3f2abb6e953b6 100644
--- a/chrome/browser/policy/device_token_fetcher_unittest.cc
+++ b/chrome/browser/policy/device_token_fetcher_unittest.cc
@@ -67,6 +67,10 @@ class DeviceTokenFetcherTest : public testing::Test {
fetcher->GetDeviceTokenPath(path);
}
+ std::string device_id(const DeviceTokenFetcher* fetcher) {
Mattias Nissler (ping if slow) 2010/11/16 18:17:40 const ref return value
Jakob Kummerow (corp) 2010/11/17 10:35:02 Done.
+ return fetcher->device_id_;
+ }
+
MessageLoop loop_;
scoped_ptr<MockDeviceManagementBackend> backend_;
ScopedTempDir temp_user_data_dir_;
@@ -166,4 +170,16 @@ TEST_F(DeviceTokenFetcherTest, FailedServerRequest) {
EXPECT_EQ("", token);
}
+TEST_F(DeviceTokenFetcherTest, UnmanagedDevice) {
+ backend_->UnmanagedDevice();
+ EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).Times(1);
+ SimulateSuccessfulLoginAndRunPending();
+ ASSERT_FALSE(fetcher_->IsTokenPending());
+ ASSERT_EQ("", fetcher_->GetDeviceToken());
+ ASSERT_EQ("", device_id(fetcher_));
+ FilePath token_path;
+ GetDeviceTokenPath(fetcher_, &token_path);
+ ASSERT_FALSE(file_util::PathExists(token_path));
+}
+
} // namespace policy
« no previous file with comments | « chrome/browser/policy/device_token_fetcher.cc ('k') | chrome/browser/policy/mock_device_management_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698