Index: chrome/installer/util/shell_util_unittest.cc |
diff --git a/chrome/installer/util/shell_util_unittest.cc b/chrome/installer/util/shell_util_unittest.cc |
index 516155d07f1e62408233f4bd995e328f156760f3..4ee9884b5f3b96f5bc9d638de86a8faa8b9d586f 100644 |
--- a/chrome/installer/util/shell_util_unittest.cc |
+++ b/chrome/installer/util/shell_util_unittest.cc |
@@ -11,6 +11,7 @@ |
#include "base/file_util.h" |
#include "base/path_service.h" |
+#include "base/md5.h" |
#include "base/scoped_temp_dir.h" |
#include "base/string16.h" |
#include "base/win/scoped_comptr.h" |
@@ -88,7 +89,7 @@ bool VerifyChromeShortcut(const std::wstring& exe_path, |
return true; |
} |
-class ShellUtilTest : public testing::Test { |
+class ShellUtilTestWithDirAndDist : public testing::Test { |
protected: |
virtual void SetUp() { |
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
@@ -103,7 +104,7 @@ class ShellUtilTest : public testing::Test { |
}; |
// Test that we can open archives successfully. |
-TEST_F(ShellUtilTest, UpdateChromeShortcutTest) { |
+TEST_F(ShellUtilTestWithDirAndDist, UpdateChromeShortcutTest) { |
// Create an executable in test path by copying ourself to it. |
wchar_t exe_full_path_str[MAX_PATH]; |
EXPECT_FALSE(::GetModuleFileName(NULL, exe_full_path_str, MAX_PATH) == 0); |
@@ -170,7 +171,7 @@ TEST_F(ShellUtilTest, UpdateChromeShortcutTest) { |
description2, 1)); |
} |
-TEST_F(ShellUtilTest, CreateChromeDesktopShortcutTest) { |
+TEST_F(ShellUtilTestWithDirAndDist, CreateChromeDesktopShortcutTest) { |
// Run this test on Vista+ only if we are running elevated. |
if (base::win::GetVersion() > base::win::VERSION_XP && !IsUserAnAdmin()) { |
LOG(ERROR) << "Must be admin to run this test on Vista+"; |
@@ -363,14 +364,14 @@ TEST_F(ShellUtilTest, CreateChromeDesktopShortcutTest) { |
profile_names)); |
} |
-TEST_F(ShellUtilTest, BuildAppModelIdBasic) { |
+TEST_F(ShellUtilTestWithDirAndDist, BuildAppModelIdBasic) { |
std::vector<string16> components; |
const string16 base_app_id(dist_->GetBaseAppId()); |
components.push_back(base_app_id); |
ASSERT_EQ(base_app_id, ShellUtil::BuildAppModelId(components)); |
} |
-TEST_F(ShellUtilTest, BuildAppModelIdManySmall) { |
+TEST_F(ShellUtilTestWithDirAndDist, BuildAppModelIdManySmall) { |
std::vector<string16> components; |
const string16 suffixed_app_id(dist_->GetBaseAppId().append(L".gab")); |
components.push_back(suffixed_app_id); |
@@ -380,7 +381,7 @@ TEST_F(ShellUtilTest, BuildAppModelIdManySmall) { |
ShellUtil::BuildAppModelId(components)); |
} |
-TEST_F(ShellUtilTest, BuildAppModelIdLongUsernameNormalProfile) { |
+TEST_F(ShellUtilTestWithDirAndDist, BuildAppModelIdLongUsernameNormalProfile) { |
std::vector<string16> components; |
const string16 long_appname( |
L"Chrome.a_user_who_has_a_crazy_long_name_with_some_weird@symbols_in_it_" |
@@ -391,7 +392,7 @@ TEST_F(ShellUtilTest, BuildAppModelIdLongUsernameNormalProfile) { |
ShellUtil::BuildAppModelId(components)); |
} |
-TEST_F(ShellUtilTest, BuildAppModelIdLongEverything) { |
+TEST_F(ShellUtilTestWithDirAndDist, BuildAppModelIdLongEverything) { |
std::vector<string16> components; |
const string16 long_appname( |
L"Chrome.a_user_who_has_a_crazy_long_name_with_some_weird@symbols_in_it_" |
@@ -404,3 +405,10 @@ TEST_F(ShellUtilTest, BuildAppModelIdLongEverything) { |
ASSERT_EQ(L"Chrome.a_user_wer_64_characters.A_crazy_profilethat_is_possible", |
constructed_app_id); |
} |
+ |
+TEST(ShellUtilTest, MD5DigestToBase32) { |
robertshield
2012/06/22 19:20:22
Please add the test cases from http://tools.ietf.o
gab
2012/06/22 20:32:12
Done (which forced me to split the implementation
|
+ base::MD5Digest digest = { 'f', 'o', 'o', 'b', 'a', 'f', 'o', 'o', 'b', 'a', |
+ 'f', 'o', 'o', 'b', 'a', 'f' }; |
+ EXPECT_EQ(L"MZXW6YTBMZXW6YTBMZXW6YTBMY", |
+ ShellUtil::MD5DigestToBase32(digest)); |
+} |