| 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/file_util.h" | 7 #include "base/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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 | 599 |
| 600 iapps::SetMacPreferencesForTesting(NULL); | 600 iapps::SetMacPreferencesForTesting(NULL); |
| 601 } | 601 } |
| 602 #endif // defined(OS_MACOSX) | 602 #endif // defined(OS_MACOSX) |
| 603 | 603 |
| 604 IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, CancelScan) { | 604 IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, CancelScan) { |
| 605 InstallDoNothingFolderFinder(); | 605 InstallDoNothingFolderFinder(); |
| 606 ASSERT_TRUE(RunMediaGalleriesTest("cancel_scan")) << message_; | 606 ASSERT_TRUE(RunMediaGalleriesTest("cancel_scan")) << message_; |
| 607 } | 607 } |
| 608 | 608 |
| 609 // The scan result dialog is not implemented on GTK because it is going away | 609 IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, Scan) { |
| 610 // soon. | |
| 611 #if defined (TOOLKIT_GTK) | |
| 612 #define MAYBE_Scan DISABLED_Scan | |
| 613 #else | |
| 614 #define MAYBE_Scan Scan | |
| 615 #endif // defined (USE_AURA) || defined(OS_MACOSX) | |
| 616 | |
| 617 IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, MAYBE_Scan) { | |
| 618 base::ScopedTempDir scan_root; | 610 base::ScopedTempDir scan_root; |
| 619 ASSERT_TRUE(scan_root.CreateUniqueTempDir()); | 611 ASSERT_TRUE(scan_root.CreateUniqueTempDir()); |
| 620 std::vector<base::FilePath> roots; | 612 std::vector<base::FilePath> roots; |
| 621 roots.push_back(scan_root.path()); | 613 roots.push_back(scan_root.path()); |
| 622 SetRootsForFolderFinder(roots); | 614 SetRootsForFolderFinder(roots); |
| 623 | 615 |
| 624 // Override addScanResults so that the dialog is accepted as soon as it is | 616 // Override addScanResults so that the dialog is accepted as soon as it is |
| 625 // created. | 617 // created. |
| 626 ASSERT_TRUE(extensions::ExtensionFunctionDispatcher::OverrideFunction( | 618 ASSERT_TRUE(extensions::ExtensionFunctionDispatcher::OverrideFunction( |
| 627 "mediaGalleries.addScanResults", | 619 "mediaGalleries.addScanResults", |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 | 662 |
| 671 base::ListValue custom_args; | 663 base::ListValue custom_args; |
| 672 #if defined(USE_PROPRIETARY_CODECS) | 664 #if defined(USE_PROPRIETARY_CODECS) |
| 673 custom_args.AppendBoolean(true); | 665 custom_args.AppendBoolean(true); |
| 674 #else | 666 #else |
| 675 custom_args.AppendBoolean(false); | 667 custom_args.AppendBoolean(false); |
| 676 #endif | 668 #endif |
| 677 ASSERT_TRUE(RunMediaGalleriesTestWithArg("media_metadata", custom_args)) | 669 ASSERT_TRUE(RunMediaGalleriesTestWithArg("media_metadata", custom_args)) |
| 678 << message_; | 670 << message_; |
| 679 } | 671 } |
| OLD | NEW |