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

Unified Diff: chrome/browser/ui/views/menu_controller_interactive_uitest.cc

Issue 1951223002: MacViews: Fix failing Menu Runner Cocoa Tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nit. Created 4 years, 7 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 | chrome/browser/ui/views/menu_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/menu_controller_interactive_uitest.cc
diff --git a/chrome/browser/ui/views/menu_controller_interactive_uitest.cc b/chrome/browser/ui/views/menu_controller_interactive_uitest.cc
index 498d2177c26b77c16a4bdfaac6505813b40c2b92..33874d171f5312b4e6c958ad5e7f6f71ac7e7c22 100644
--- a/chrome/browser/ui/views/menu_controller_interactive_uitest.cc
+++ b/chrome/browser/ui/views/menu_controller_interactive_uitest.cc
@@ -93,3 +93,32 @@ typedef MenuControllerMnemonicTest<ui::VKEY_A,0>
#endif
VIEW_TEST(MenuControllerMnemonicTestNoMatch, MAYBE_NoMatch);
+
+class MenuRunnerCancelTest : public MenuTestBase {
+ public:
+ MenuRunnerCancelTest() {}
+
+ // MenuTestBase overrides:
+ void BuildMenu(views::MenuItemView* menu) override {
+ menu->AppendMenuItemWithLabel(1, base::ASCIIToUTF16("One&/"));
+ menu->AppendMenuItemWithLabel(2, base::ASCIIToUTF16("Two"));
+ }
+
+ void DoTestWithMenuOpen() override {
+ ASSERT_EQ(true, menu_runner()->IsRunning());
+ menu_runner()->Cancel();
+ // On calling Cancel, the nested message loop spun by the menu, should be
+ // marked for termination. However, since we are still in the last
+ // iteration of the nested message loop, MenuRunner::IsRunning(), should
+ // return true.
+ ASSERT_EQ(true, menu_runner()->IsRunning());
+ Done();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MenuRunnerCancelTest);
+};
+
+// Test that MenuRunner::IsRunning() returns true, immediately after calling
+// MenuRunner::Cancel() for a syncronous menu.
+VIEW_TEST(MenuRunnerCancelTest, IsRunningAfterCancel);
« no previous file with comments | « no previous file | chrome/browser/ui/views/menu_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698