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

Side by Side Diff: chrome/installer/setup/install_unittest.cc

Issue 2258243002: Consistently use namespaced base::Version in chrome/installer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/setup/install_worker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/installer/setup/install.h" 5 #include "chrome/installer/setup/install.h"
6 6
7 #include <objbase.h> 7 #include <objbase.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 EXPECT_TRUE(base::NormalizeFilePath(path, &normalized_path)); 42 EXPECT_TRUE(base::NormalizeFilePath(path, &normalized_path));
43 return normalized_path; 43 return normalized_path;
44 } 44 }
45 45
46 class CreateVisualElementsManifestTest : public testing::Test { 46 class CreateVisualElementsManifestTest : public testing::Test {
47 protected: 47 protected:
48 void SetUp() override { 48 void SetUp() override {
49 // Create a temp directory for testing. 49 // Create a temp directory for testing.
50 ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); 50 ASSERT_TRUE(test_dir_.CreateUniqueTempDir());
51 51
52 version_ = Version("0.0.0.0"); 52 version_ = base::Version("0.0.0.0");
53 53
54 version_dir_ = test_dir_.path().AppendASCII(version_.GetString()); 54 version_dir_ = test_dir_.path().AppendASCII(version_.GetString());
55 ASSERT_TRUE(base::CreateDirectory(version_dir_)); 55 ASSERT_TRUE(base::CreateDirectory(version_dir_));
56 56
57 manifest_path_ = 57 manifest_path_ =
58 test_dir_.path().Append(installer::kVisualElementsManifest); 58 test_dir_.path().Append(installer::kVisualElementsManifest);
59 } 59 }
60 60
61 void TearDown() override { 61 void TearDown() override {
62 // Clean up test directory manually so we can fail if it leaks. 62 // Clean up test directory manually so we can fail if it leaks.
63 ASSERT_TRUE(test_dir_.Delete()); 63 ASSERT_TRUE(test_dir_.Delete());
64 } 64 }
65 65
66 // The temporary directory used to contain the test operations. 66 // The temporary directory used to contain the test operations.
67 base::ScopedTempDir test_dir_; 67 base::ScopedTempDir test_dir_;
68 68
69 // A dummy version number used to create the version directory. 69 // A dummy version number used to create the version directory.
70 Version version_; 70 base::Version version_;
71 71
72 // The path to |test_dir_|\|version_|. 72 // The path to |test_dir_|\|version_|.
73 base::FilePath version_dir_; 73 base::FilePath version_dir_;
74 74
75 // The path to VisualElementsManifest.xml. 75 // The path to VisualElementsManifest.xml.
76 base::FilePath manifest_path_; 76 base::FilePath manifest_path_;
77 }; 77 };
78 78
79 class InstallShortcutTest : public testing::Test { 79 class InstallShortcutTest : public testing::Test {
80 protected: 80 protected:
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 installer::EscapeXmlAttributeValueInSingleQuotes(&val); 814 installer::EscapeXmlAttributeValueInSingleQuotes(&val);
815 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); 815 ASSERT_STREQ(kExpectedEscapedVal, val.c_str());
816 } 816 }
817 817
818 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { 818 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) {
819 base::string16 val(L"Google Chrome"); 819 base::string16 val(L"Google Chrome");
820 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; 820 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome";
821 installer::EscapeXmlAttributeValueInSingleQuotes(&val); 821 installer::EscapeXmlAttributeValueInSingleQuotes(&val);
822 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); 822 ASSERT_STREQ(kExpectedEscapedVal, val.c_str());
823 } 823 }
OLDNEW
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/setup/install_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698