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

Unified Diff: chrome_frame/test/ui_test.cc

Issue 3156026: Add a method for setting the value of an Accessibility object.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « chrome_frame/test/mock_ie_event_sink_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/ui_test.cc
===================================================================
--- chrome_frame/test/ui_test.cc (revision 56373)
+++ chrome_frame/test/ui_test.cc (working copy)
@@ -6,6 +6,7 @@
#include <string>
#include "base/scoped_variant_win.h"
+#include "base/test/test_file_util.h"
#include "chrome/common/url_constants.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/chrome_frame_ui_test_utils.h"
@@ -443,7 +444,7 @@
kChromeFrameLongNavigationTimeoutInSeconds * 2);
}
-TEST_F(ContextMenuTest, FLAKY_CFSaveAs) {
+TEST_F(ContextMenuTest, CFSaveAs) {
server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag());
MockWindowObserver win_observer_mock;
InSequence expect_in_sequence_for_scope;
@@ -457,24 +458,22 @@
EXPECT_CALL(acc_observer_, OnMenuPopup(_))
.WillOnce(DoDefaultAction(AccObjectMatcher(L"Save as...")));
+ // Get safe download name using temporary file.
FilePath temp_file_path;
- EXPECT_TRUE(file_util::CreateTemporaryFile(&temp_file_path));
+ ASSERT_TRUE(file_util::CreateTemporaryFile(&temp_file_path));
temp_file_path = temp_file_path.ReplaceExtension(L".htm");
+ ASSERT_TRUE(file_util::DieFileDie(temp_file_path, false));
- const wchar_t* kSaveFileName = temp_file_path.value().c_str();
- DeleteFile(kSaveFileName);
-
- const char* kSaveDlgCaption = "Save As";
- EXPECT_CALL(win_observer_mock, OnWindowDetected(_, StrEq(kSaveDlgCaption)))
+ EXPECT_CALL(win_observer_mock, OnWindowDetected(_, StrEq("Save As")))
.WillOnce(testing::DoAll(
- DelaySendString(&loop_, 100, kSaveFileName),
- DelaySendChar(&loop_, 200, VK_RETURN, simulate_input::NONE),
- DelayCloseBrowserMock(&loop_, 4000, &ie_mock_)));
+ SetAccObjectValue(AccObjectMatcher(L"File name:", L"", L"simple*"),
+ temp_file_path.value()),
+ DoDefaultAction(AccObjectMatcher(L"Save", L"push button")),
+ CloseWhenFileSaved(&ie_mock_, temp_file_path, 5000)));
LaunchIENavigateAndLoop(GetSimplePageUrl(),
kChromeFrameLongNavigationTimeoutInSeconds * 2);
- ASSERT_NE(INVALID_FILE_ATTRIBUTES, GetFileAttributes(kSaveFileName));
- ASSERT_TRUE(DeleteFile(kSaveFileName));
+ ASSERT_TRUE(file_util::DieFileDie(temp_file_path, false));
}
// This tests that the about:version page can be opened via the CF context menu.
« no previous file with comments | « chrome_frame/test/mock_ie_event_sink_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698