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

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

Issue 9133027: Mark ExtensionFileUtil.BackgroundScriptsMustExist as flaky on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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
« 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) 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/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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 "}", non_ascii_file.c_str()); 311 "}", non_ascii_file.c_str());
312 std::string error; 312 std::string error;
313 scoped_refptr<Extension> extension = LoadExtensionManifest( 313 scoped_refptr<Extension> extension = LoadExtensionManifest(
314 kManifest, temp.path(), Extension::LOAD, 0, &error); 314 kManifest, temp.path(), Extension::LOAD, 0, &error);
315 ASSERT_TRUE(extension.get()) << error; 315 ASSERT_TRUE(extension.get()) << error;
316 316
317 EXPECT_TRUE(extension_file_util::ValidateExtension(extension, &error)) << 317 EXPECT_TRUE(extension_file_util::ValidateExtension(extension, &error)) <<
318 error; 318 error;
319 } 319 }
320 320
321 TEST(ExtensionFileUtil, BackgroundScriptsMustExist) { 321 #if defined(OS_WIN)
322 // This test is flaky on Windows. http://crbug.com/110279
323 #define MAYBE_BackgroundScriptsMustExist FLAKY_BackgroundScriptsMustExist
324 #else
325 #define MAYBE_BackgroundScriptsMustExist BackgroundScriptsMustExist
326 #endif
327 TEST(ExtensionFileUtil, MAYBE_BackgroundScriptsMustExist) {
322 ScopedTempDir temp; 328 ScopedTempDir temp;
323 ASSERT_TRUE(temp.CreateUniqueTempDir()); 329 ASSERT_TRUE(temp.CreateUniqueTempDir());
324 330
325 scoped_ptr<DictionaryValue> value(new DictionaryValue()); 331 scoped_ptr<DictionaryValue> value(new DictionaryValue());
326 value->SetString("name", "test"); 332 value->SetString("name", "test");
327 value->SetString("version", "1"); 333 value->SetString("version", "1");
328 value->SetInteger("manifest_version", 1); 334 value->SetInteger("manifest_version", 1);
329 335
330 ListValue* scripts = new ListValue(); 336 ListValue* scripts = new ListValue();
331 scripts->Append(Value::CreateStringValue("foo.js")); 337 scripts->Append(Value::CreateStringValue("foo.js"));
(...skipping 19 matching lines...) Expand all
351 EXPECT_FALSE(extension_file_util::ValidateExtension(extension, &error)); 357 EXPECT_FALSE(extension_file_util::ValidateExtension(extension, &error));
352 EXPECT_EQ(l10n_util::GetStringFUTF8( 358 EXPECT_EQ(l10n_util::GetStringFUTF8(
353 IDS_EXTENSION_LOAD_BACKGROUND_SCRIPT_FAILED, 359 IDS_EXTENSION_LOAD_BACKGROUND_SCRIPT_FAILED,
354 ASCIIToUTF16("http://google.com/foo.js")), 360 ASCIIToUTF16("http://google.com/foo.js")),
355 error); 361 error);
356 } 362 }
357 363
358 // TODO(aa): More tests as motivation allows. Maybe steal some from 364 // TODO(aa): More tests as motivation allows. Maybe steal some from
359 // ExtensionService? Many of them could probably be tested here without the 365 // ExtensionService? Many of them could probably be tested here without the
360 // MessageLoop shenanigans. 366 // 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