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

Side by Side Diff: chrome/common/extensions/extension_file_util_unittest.cc

Issue 8919018: Marking ExtensionFileUtil.CheckIllegalFilenamesOnlyReserved as DISABLED on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/common/extensions/extension_file_util.h" 5 #include "chrome/common/extensions/extension_file_util.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_value_serializer.h" 8 #include "base/json/json_value_serializer.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 ASSERT_TRUE(file_util::CreateDirectory(src_path)); 119 ASSERT_TRUE(file_util::CreateDirectory(src_path));
120 120
121 std::string data = "{ \"name\": { \"message\": \"foobar\" } }"; 121 std::string data = "{ \"name\": { \"message\": \"foobar\" } }";
122 ASSERT_TRUE(file_util::WriteFile(src_path.AppendASCII("some_file.txt"), 122 ASSERT_TRUE(file_util::WriteFile(src_path.AppendASCII("some_file.txt"),
123 data.c_str(), data.length())); 123 data.c_str(), data.length()));
124 std::string error; 124 std::string error;
125 EXPECT_TRUE(extension_file_util::CheckForIllegalFilenames(temp.path(), 125 EXPECT_TRUE(extension_file_util::CheckForIllegalFilenames(temp.path(),
126 &error)); 126 &error));
127 } 127 }
128 128
129 #if defined(OS_WIN)
130 // http://crbug.com/106381
131 #define CheckIllegalFilenamesOnlyReserved \
132 DISABLED_CheckIllegalFilenamesOnlyReserved
133 #endif
129 TEST(ExtensionFileUtil, CheckIllegalFilenamesOnlyReserved) { 134 TEST(ExtensionFileUtil, CheckIllegalFilenamesOnlyReserved) {
130 ScopedTempDir temp; 135 ScopedTempDir temp;
131 ASSERT_TRUE(temp.CreateUniqueTempDir()); 136 ASSERT_TRUE(temp.CreateUniqueTempDir());
132 137
133 FilePath src_path = temp.path().Append(Extension::kLocaleFolder); 138 FilePath src_path = temp.path().Append(Extension::kLocaleFolder);
134 ASSERT_TRUE(file_util::CreateDirectory(src_path)); 139 ASSERT_TRUE(file_util::CreateDirectory(src_path));
135 140
136 std::string error; 141 std::string error;
137 EXPECT_TRUE(extension_file_util::CheckForIllegalFilenames(temp.path(), 142 EXPECT_TRUE(extension_file_util::CheckForIllegalFilenames(temp.path(),
138 &error)); 143 &error));
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 kManifest, temp.path(), Extension::LOAD, 0, &error); 291 kManifest, temp.path(), Extension::LOAD, 0, &error);
287 ASSERT_TRUE(extension.get()) << error; 292 ASSERT_TRUE(extension.get()) << error;
288 293
289 EXPECT_TRUE(extension_file_util::ValidateExtension(extension, &error)) << 294 EXPECT_TRUE(extension_file_util::ValidateExtension(extension, &error)) <<
290 error; 295 error;
291 } 296 }
292 297
293 // TODO(aa): More tests as motivation allows. Maybe steal some from 298 // TODO(aa): More tests as motivation allows. Maybe steal some from
294 // ExtensionService? Many of them could probably be tested here without the 299 // ExtensionService? Many of them could probably be tested here without the
295 // MessageLoop shenanigans. 300 // MessageLoop shenanigans.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698