diff options
author | pneubeck@google.com <pneubeck@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-19 12:43:34 +0000 |
---|---|---|
committer | pneubeck@google.com <pneubeck@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-19 12:43:34 +0000 |
commit | decc7cda17b3454df8d7d70bc4e8985f65264bc7 (patch) | |
tree | 645ee98d66b835c50007ada0729b3c6d992e19a9 /chrome/browser/web_applications | |
parent | c280dbfa4ac454575bd47e076e0aa6935bbf1fd0 (diff) | |
download | chromium_src-decc7cda17b3454df8d7d70bc4e8985f65264bc7.zip chromium_src-decc7cda17b3454df8d7d70bc4e8985f65264bc7.tar.gz chromium_src-decc7cda17b3454df8d7d70bc4e8985f65264bc7.tar.bz2 |
Make WebAppShortcutCreatorTest.CreateFailure independent of path existence.
Unit test WebAppShortcutCreatorTest.CreateFailure depended on the existence of
the absolute path /non-existant/path/. That path was created by mistake when
this test was run at revision r188944.
Thus the test broke:
http://build.chromium.org/p/chromium.mac/buildstatus?builder=Mac%2010.6%20Tests%20%28dbg%29%284%29&number=25266
Changing the test to use a non-existent subfolder of a temporary folder instead.
BUG=NONE
TBR=benwells@chromium.org, jeremya@chromium.org
Review URL: https://codereview.chromium.org/12755028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189000 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_applications')
-rw-r--r-- | chrome/browser/web_applications/web_app_mac_unittest.mm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/web_applications/web_app_mac_unittest.mm b/chrome/browser/web_applications/web_app_mac_unittest.mm index ee6b647..75643f62 100644 --- a/chrome/browser/web_applications/web_app_mac_unittest.mm +++ b/chrome/browser/web_applications/web_app_mac_unittest.mm @@ -102,7 +102,6 @@ TEST(WebAppShortcutCreatorTest, RunShortcut) { ShellIntegration::ShortcutInfo info = GetShortcutInfo(); base::FilePath dst_folder = scoped_temp_dir.path(); - dst_folder = base::FilePath("/Applications"); base::FilePath dst_path = dst_folder.Append(UTF16ToUTF8(info.title) + ".app"); NiceMock<WebAppShortcutCreatorMock> shortcut_creator(info); @@ -120,9 +119,15 @@ TEST(WebAppShortcutCreatorTest, RunShortcut) { } TEST(WebAppShortcutCreatorTest, CreateFailure) { + base::ScopedTempDir scoped_temp_dir; + EXPECT_TRUE(scoped_temp_dir.CreateUniqueTempDir()); + + base::FilePath non_existent_path = + scoped_temp_dir.path().Append("not-existent").Append("name.app"); + NiceMock<WebAppShortcutCreatorMock> shortcut_creator(GetShortcutInfo()); EXPECT_CALL(shortcut_creator, GetDestinationPath(_)) - .WillRepeatedly(Return(base::FilePath("/non-existant/path/"))); + .WillRepeatedly(Return(non_existent_path)); EXPECT_FALSE(shortcut_creator.CreateShortcut()); } |