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

Side by Side Diff: ui/views/mus/display_list_unittest.cc

Issue 1998543004: Fixes crash in ~ShellConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/mus/views_mus_test_suite.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/views/mus/display_list.h" 5 #include "ui/views/mus/display_list.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 AddPartChange(changed_metrics, DISPLAY_METRIC_PRIMARY, "primary", &parts); 64 AddPartChange(changed_metrics, DISPLAY_METRIC_PRIMARY, "primary", &parts);
65 65
66 AddChange("Changed id=" + base::Int64ToString(display.id()) + parts); 66 AddChange("Changed id=" + base::Int64ToString(display.id()) + parts);
67 } 67 }
68 68
69 std::string changes_; 69 std::string changes_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(DisplayObserverImpl); 71 DISALLOW_COPY_AND_ASSIGN(DisplayObserverImpl);
72 }; 72 };
73 73
74 // Test fails on linux_chromium_rel_ng, http://crbug.com/613018 74 TEST(DisplayListTest, AddUpdateRemove) {
75 TEST(DisplayListTest, DISABLED_AddUpdateRemove) {
76 DisplayList display_list; 75 DisplayList display_list;
77 DisplayObserverImpl observer; 76 DisplayObserverImpl observer;
78 display_list.AddObserver(&observer); 77 display_list.AddObserver(&observer);
79 display_list.AddDisplay(display::Display(2, gfx::Rect(0, 0, 801, 802)), 78 display_list.AddDisplay(display::Display(2, gfx::Rect(0, 0, 801, 802)),
80 DisplayList::Type::PRIMARY); 79 DisplayList::Type::PRIMARY);
81 EXPECT_EQ("Added id=2", observer.GetAndClearChanges()); 80 EXPECT_EQ("Added id=2", observer.GetAndClearChanges());
82 81
83 // Update the bounds. 82 // Update the bounds.
84 { 83 {
85 display::Display updated_display = *(display_list.displays().begin()); 84 display::Display updated_display = *(display_list.displays().begin());
(...skipping 19 matching lines...) Expand all
105 104
106 // Delete the first. 105 // Delete the first.
107 display_list.RemoveDisplay(2); 106 display_list.RemoveDisplay(2);
108 ASSERT_EQ(1u, display_list.displays().size()); 107 ASSERT_EQ(1u, display_list.displays().size());
109 EXPECT_EQ("Removed id=2", observer.GetAndClearChanges()); 108 EXPECT_EQ("Removed id=2", observer.GetAndClearChanges());
110 EXPECT_EQ(3, display_list.GetPrimaryDisplayIterator()->id()); 109 EXPECT_EQ(3, display_list.GetPrimaryDisplayIterator()->id());
111 } 110 }
112 111
113 } // namespace 112 } // namespace
114 } // namespace views 113 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/mus/views_mus_test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698