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

Side by Side Diff: ui/aura/mus/window_tree_client_unittest.cc

Issue 2454973003: Wires up modality for aura-mus (Closed)
Patch Set: cleanup Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/aura/mus/window_tree_client.h" 5 #include "ui/aura/mus/window_tree_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 capture_recorder.reset_capture_captured_count(); 1041 capture_recorder.reset_capture_captured_count();
1042 1042
1043 // Changes originating from server should notify observers too. 1043 // Changes originating from server should notify observers too.
1044 window_tree_client()->OnCaptureChanged(server_id(&child2), 0); 1044 window_tree_client()->OnCaptureChanged(server_id(&child2), 0);
1045 EXPECT_EQ(1, capture_recorder.capture_changed_count()); 1045 EXPECT_EQ(1, capture_recorder.capture_changed_count());
1046 EXPECT_EQ(child2_id, capture_recorder.last_gained_capture_window_id()); 1046 EXPECT_EQ(child2_id, capture_recorder.last_gained_capture_window_id());
1047 EXPECT_EQ(0, capture_recorder.last_lost_capture_window_id()); 1047 EXPECT_EQ(0, capture_recorder.last_lost_capture_window_id());
1048 capture_recorder.reset_capture_captured_count(); 1048 capture_recorder.reset_capture_captured_count();
1049 } 1049 }
1050 1050
1051 TEST_F(WindowTreeClientClientTest, Modal) {
msw 2016/10/27 18:37:37 nit: test a successful change, sequential changes,
sky 2016/10/27 19:30:06 I added a successful test. Sequential doesn't real
1052 Window window(nullptr);
1053 window.Init(ui::LAYER_NOT_DRAWN);
1054 window.SetProperty(client::kModalKey, ui::MODAL_TYPE_WINDOW);
1055 // Make sure server was told about it, and have the server say it failed.
1056 ASSERT_TRUE(
1057 window_tree()->AckSingleChangeOfType(WindowTreeChangeType::MODAL, false));
1058 // Type should be back to MODAL_TYPE_NONE as the server didn't accept the
1059 // change.
1060 EXPECT_EQ(ui::MODAL_TYPE_NONE, window.GetProperty(client::kModalKey));
1061 // There should be no more modal changes.
1062 EXPECT_FALSE(
1063 window_tree()->AckSingleChangeOfType(WindowTreeChangeType::MODAL, false));
1064 }
1065
1051 } // namespace aura 1066 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698