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

Unified Diff: apps/app_shim/app_shim_interactive_uitest_mac.mm

Issue 598443002: [Mac] Re-enable AppShimInteractiveTest.Launch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_shim/app_shim_interactive_uitest_mac.mm
diff --git a/apps/app_shim/app_shim_interactive_uitest_mac.mm b/apps/app_shim/app_shim_interactive_uitest_mac.mm
index c065ea51b184215993a82c972535ec69f720c0d1..f6ce7c532708d7bd236d2440b377e8af82c9ab30 100644
--- a/apps/app_shim/app_shim_interactive_uitest_mac.mm
+++ b/apps/app_shim/app_shim_interactive_uitest_mac.mm
@@ -53,11 +53,12 @@ class AppShimInteractiveTest : public extensions::PlatformAppBrowserTest {
class WindowedFilePathWatcher
: public base::RefCountedThreadSafe<WindowedFilePathWatcher> {
public:
- WindowedFilePathWatcher(const base::FilePath& path) : observed_(false) {
+ WindowedFilePathWatcher(const base::FilePath& path)
+ : path_(path), observed_(false) {
content::BrowserThread::PostTask(
content::BrowserThread::FILE,
FROM_HERE,
- base::Bind(&WindowedFilePathWatcher::Watch, this, path));
+ base::Bind(&WindowedFilePathWatcher::Watch, this, path.DirName()));
}
void Wait() {
@@ -78,10 +79,13 @@ class WindowedFilePathWatcher
}
void Observe(const base::FilePath& path, bool error) {
- content::BrowserThread::PostTask(
- content::BrowserThread::UI,
- FROM_HERE,
- base::Bind(&WindowedFilePathWatcher::StopRunLoop, this));
+ DCHECK(!error);
+ if (base::PathExists(path_)) {
+ content::BrowserThread::PostTask(
tapted 2014/09/23 06:28:41 watcher_->Cancel() before this? Not entirely sure
jackhou1 2014/09/23 07:34:06 Done.
+ content::BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&WindowedFilePathWatcher::StopRunLoop, this));
+ }
}
void StopRunLoop() {
@@ -91,6 +95,7 @@ class WindowedFilePathWatcher
}
private:
+ base::FilePath path_;
tapted 2014/09/23 06:28:41 nit: const?
jackhou1 2014/09/23 07:34:06 Done.
base::FilePathWatcher watcher_;
bool observed_;
scoped_ptr<base::RunLoop> run_loop_;
@@ -214,8 +219,7 @@ bool HasAppShimHost(Profile* profile, const std::string& app_id) {
namespace apps {
// Shims require static libraries http://crbug.com/386024.
-// This test is flaky on OSX. http://crbug.com/415422
-#if defined(COMPONENT_BUILD) || defined(OS_MACOSX)
+#if defined(COMPONENT_BUILD)
#define MAYBE_Launch DISABLED_Launch
#define MAYBE_RebuildShim DISABLED_RebuildShim
#else
@@ -247,6 +251,7 @@ IN_PROC_BROWSER_TEST_F(AppShimInteractiveTest, MAYBE_Launch) {
new WindowedFilePathWatcher(shim_path);
web_app::UpdateAllShortcuts(base::string16(), profile(), app);
file_watcher->Wait();
+ ASSERT_TRUE(base::PathExists(shim_path));
NSString* bundle_id = GetBundleID(shim_path);
// Case 1: Launch the shim, it should start the app.
« 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