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