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

Unified Diff: chrome/installer/util/shell_util_unittest.cc

Issue 10667006: Revert 143782 - Use a better registration suffix that will always be unique while respecting the MS… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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/installer/util/shell_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/shell_util_unittest.cc
===================================================================
--- chrome/installer/util/shell_util_unittest.cc (revision 143832)
+++ chrome/installer/util/shell_util_unittest.cc (working copy)
@@ -11,7 +11,6 @@
#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"
@@ -89,7 +88,7 @@
return true;
}
-class ShellUtilTestWithDirAndDist : public testing::Test {
+class ShellUtilTest : public testing::Test {
protected:
virtual void SetUp() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
@@ -104,7 +103,7 @@
};
// Test that we can open archives successfully.
-TEST_F(ShellUtilTestWithDirAndDist, UpdateChromeShortcutTest) {
+TEST_F(ShellUtilTest, 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);
@@ -171,7 +170,7 @@
description2, 1));
}
-TEST_F(ShellUtilTestWithDirAndDist, CreateChromeDesktopShortcutTest) {
+TEST_F(ShellUtilTest, 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+";
@@ -364,14 +363,14 @@
profile_names));
}
-TEST_F(ShellUtilTestWithDirAndDist, BuildAppModelIdBasic) {
+TEST_F(ShellUtilTest, 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(ShellUtilTestWithDirAndDist, BuildAppModelIdManySmall) {
+TEST_F(ShellUtilTest, BuildAppModelIdManySmall) {
std::vector<string16> components;
const string16 suffixed_app_id(dist_->GetBaseAppId().append(L".gab"));
components.push_back(suffixed_app_id);
@@ -381,7 +380,7 @@
ShellUtil::BuildAppModelId(components));
}
-TEST_F(ShellUtilTestWithDirAndDist, BuildAppModelIdLongUsernameNormalProfile) {
+TEST_F(ShellUtilTest, 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_"
@@ -392,7 +391,7 @@
ShellUtil::BuildAppModelId(components));
}
-TEST_F(ShellUtilTestWithDirAndDist, BuildAppModelIdLongEverything) {
+TEST_F(ShellUtilTest, 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_"
@@ -405,25 +404,3 @@
ASSERT_EQ(L"Chrome.a_user_wer_64_characters.A_crazy_profilethat_is_possible",
constructed_app_id);
}
-
-TEST(ShellUtilTest, MD5DigestToBase32) {
- const 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));
-}
-
-TEST(ShellUtilTest, ByteArrayToBase32) {
- // Tests from http://tools.ietf.org/html/rfc4648#section-10.
- const unsigned char test_array[] = { 'f', 'o', 'o', 'b', 'a', 'r' };
-
- const string16 expected[] = { L"", L"MY", L"MZXQ", L"MZXW6", L"MZXW6YQ",
- L"MZXW6YTB", L"MZXW6YTBOI"};
-
- // Run the tests, with one more letter in the input every pass.
- for (int i = 0; i < arraysize(expected); ++i) {
- EXPECT_EQ(expected[i],
- ShellUtil::ByteArrayToBase32(test_array, i));
- }
-
-}
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698