OLD | NEW |
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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 std::string device_id_; | 434 std::string device_id_; |
435 base::ScopedTempDir fake_gallery_temp_dir_; | 435 base::ScopedTempDir fake_gallery_temp_dir_; |
436 int test_jpg_size_; | 436 int test_jpg_size_; |
437 scoped_ptr<EnsureMediaDirectoriesExists> ensure_media_directories_exists_; | 437 scoped_ptr<EnsureMediaDirectoriesExists> ensure_media_directories_exists_; |
438 }; | 438 }; |
439 | 439 |
440 #if !defined(DISABLE_NACL) | 440 #if !defined(DISABLE_NACL) |
441 class MediaGalleriesPlatformAppPpapiTest | 441 class MediaGalleriesPlatformAppPpapiTest |
442 : public MediaGalleriesPlatformAppBrowserTest { | 442 : public MediaGalleriesPlatformAppBrowserTest { |
443 protected: | 443 protected: |
444 void SetUpCommandLine(CommandLine* command_line) override { | 444 void SetUpCommandLine(base::CommandLine* command_line) override { |
445 MediaGalleriesPlatformAppBrowserTest::SetUpCommandLine(command_line); | 445 MediaGalleriesPlatformAppBrowserTest::SetUpCommandLine(command_line); |
446 command_line->AppendSwitch(switches::kEnablePepperTesting); | 446 command_line->AppendSwitch(switches::kEnablePepperTesting); |
447 } | 447 } |
448 | 448 |
449 void SetUpOnMainThread() override { | 449 void SetUpOnMainThread() override { |
450 MediaGalleriesPlatformAppBrowserTest::SetUpOnMainThread(); | 450 MediaGalleriesPlatformAppBrowserTest::SetUpOnMainThread(); |
451 | 451 |
452 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &app_dir_)); | 452 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &app_dir_)); |
453 app_dir_ = app_dir_.AppendASCII("ppapi") | 453 app_dir_ = app_dir_.AppendASCII("ppapi") |
454 .AppendASCII("tests") | 454 .AppendASCII("tests") |
(...skipping 14 matching lines...) Expand all Loading... |
469 RemoveAllGalleries(); | 469 RemoveAllGalleries(); |
470 MakeSingleFakeGallery(NULL); | 470 MakeSingleFakeGallery(NULL); |
471 | 471 |
472 const extensions::Extension* extension = LoadExtension(app_dir()); | 472 const extensions::Extension* extension = LoadExtension(app_dir()); |
473 ASSERT_TRUE(extension); | 473 ASSERT_TRUE(extension); |
474 | 474 |
475 extensions::ResultCatcher catcher; | 475 extensions::ResultCatcher catcher; |
476 AppLaunchParams params(browser()->profile(), extension, | 476 AppLaunchParams params(browser()->profile(), extension, |
477 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, | 477 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, |
478 extensions::SOURCE_TEST); | 478 extensions::SOURCE_TEST); |
479 params.command_line = *CommandLine::ForCurrentProcess(); | 479 params.command_line = *base::CommandLine::ForCurrentProcess(); |
480 OpenApplication(params); | 480 OpenApplication(params); |
481 | 481 |
482 bool result = true; | 482 bool result = true; |
483 if (!catcher.GetNextResult()) { | 483 if (!catcher.GetNextResult()) { |
484 message_ = catcher.message(); | 484 message_ = catcher.message(); |
485 result = false; | 485 result = false; |
486 } | 486 } |
487 content::RunAllPendingInMessageLoop(); // avoid race on exit in registry. | 487 content::RunAllPendingInMessageLoop(); // avoid race on exit in registry. |
488 ASSERT_TRUE(result) << message_; | 488 ASSERT_TRUE(result) << message_; |
489 } | 489 } |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 | 671 |
672 base::ListValue custom_args; | 672 base::ListValue custom_args; |
673 #if defined(USE_PROPRIETARY_CODECS) | 673 #if defined(USE_PROPRIETARY_CODECS) |
674 custom_args.AppendBoolean(true); | 674 custom_args.AppendBoolean(true); |
675 #else | 675 #else |
676 custom_args.AppendBoolean(false); | 676 custom_args.AppendBoolean(false); |
677 #endif | 677 #endif |
678 ASSERT_TRUE(RunMediaGalleriesTestWithArg("media_metadata", custom_args)) | 678 ASSERT_TRUE(RunMediaGalleriesTestWithArg("media_metadata", custom_args)) |
679 << message_; | 679 << message_; |
680 } | 680 } |
OLD | NEW |