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

Side by Side Diff: chrome/browser/chromeos/policy/enterprise_install_attributes_unittest.cc

Issue 477663004: Merged FakedDBusThreadManager with DBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/chromeos/policy/enterprise_install_attributes.h" 5 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 29 matching lines...) Expand all
40 static const char kTestDeviceId[] = "133750519"; 40 static const char kTestDeviceId[] = "133750519";
41 41
42 class EnterpriseInstallAttributesTest : public testing::Test { 42 class EnterpriseInstallAttributesTest : public testing::Test {
43 protected: 43 protected:
44 EnterpriseInstallAttributesTest() {} 44 EnterpriseInstallAttributesTest() {}
45 45
46 virtual void SetUp() OVERRIDE { 46 virtual void SetUp() OVERRIDE {
47 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 47 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
48 ASSERT_TRUE(PathService::OverrideAndCreateIfNeeded( 48 ASSERT_TRUE(PathService::OverrideAndCreateIfNeeded(
49 chromeos::FILE_INSTALL_ATTRIBUTES, GetTempPath(), true, false)); 49 chromeos::FILE_INSTALL_ATTRIBUTES, GetTempPath(), true, false));
50 chromeos::DBusThreadManager::InitializeWithStub(); 50 chromeos::DBusThreadManager::Initialize();
51 install_attributes_.reset(new EnterpriseInstallAttributes( 51 install_attributes_.reset(new EnterpriseInstallAttributes(
52 chromeos::DBusThreadManager::Get()->GetCryptohomeClient())); 52 chromeos::DBusThreadManager::Get()->GetCryptohomeClient()));
53 } 53 }
54 54
55 virtual void TearDown() OVERRIDE { 55 virtual void TearDown() OVERRIDE {
56 chromeos::DBusThreadManager::Shutdown(); 56 chromeos::DBusThreadManager::Shutdown();
57 } 57 }
58 58
59 base::FilePath GetTempPath() const { 59 base::FilePath GetTempPath() const {
60 base::FilePath temp_path = base::MakeAbsoluteFilePath(temp_dir_.path()); 60 base::FilePath temp_path = base::MakeAbsoluteFilePath(temp_dir_.path());
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 EnterpriseInstallAttributes::kAttrEnterpriseUser, kTestUser)); 278 EnterpriseInstallAttributes::kAttrEnterpriseUser, kTestUser));
279 ASSERT_TRUE(cryptohome_util::InstallAttributesFinalize()); 279 ASSERT_TRUE(cryptohome_util::InstallAttributesFinalize());
280 280
281 // Verify that EnterpriseInstallAttributes correctly decodes the stub 281 // Verify that EnterpriseInstallAttributes correctly decodes the stub
282 // cache file. 282 // cache file.
283 install_attributes_->ReadCacheFile(GetTempPath()); 283 install_attributes_->ReadCacheFile(GetTempPath());
284 EXPECT_EQ(kTestUser, install_attributes_->GetRegistrationUser()); 284 EXPECT_EQ(kTestUser, install_attributes_->GetRegistrationUser());
285 } 285 }
286 286
287 } // namespace policy 287 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698