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

Side by Side Diff: chrome/browser/ui/exclusive_access/fullscreen_controller_state_test.cc

Issue 815363002: replace COMPILE_ASSERT with static_assert in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixup 2 Created 6 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/exclusive_access/fullscreen_controller_state_test.h" 5 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_state_test.h"
6 6
7 #include <memory.h> 7 #include <memory.h>
8 8
9 #include <iomanip> 9 #include <iomanip>
10 #include <iostream> 10 #include <iostream>
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 STATE_TO_TAB_FULLSCREEN, // Event BUBBLE_ALLOW 192 STATE_TO_TAB_FULLSCREEN, // Event BUBBLE_ALLOW
193 #if defined(OS_MACOSX) 193 #if defined(OS_MACOSX)
194 // Mac window reports fullscreen immediately and an exit triggers exit. 194 // Mac window reports fullscreen immediately and an exit triggers exit.
195 STATE_TO_NORMAL, // Event BUBBLE_DENY 195 STATE_TO_NORMAL, // Event BUBBLE_DENY
196 #else 196 #else
197 STATE_TO_TAB_FULLSCREEN, // Event BUBBLE_DENY 197 STATE_TO_TAB_FULLSCREEN, // Event BUBBLE_DENY
198 #endif 198 #endif
199 STATE_TAB_FULLSCREEN, // Event WINDOW_CHANGE 199 STATE_TAB_FULLSCREEN, // Event WINDOW_CHANGE
200 }, 200 },
201 }; 201 };
202 COMPILE_ASSERT(sizeof(transition_table_data) == sizeof(transition_table_), 202 static_assert(sizeof(transition_table_data) == sizeof(transition_table_),
203 transition_table_incorrect_size); 203 "transition_table has unexpected size");
204 memcpy(transition_table_, transition_table_data, 204 memcpy(transition_table_, transition_table_data,
205 sizeof(transition_table_data)); 205 sizeof(transition_table_data));
206 206
207 // Verify that transition_table_ has been completely defined. 207 // Verify that transition_table_ has been completely defined.
208 for (int source = 0; source < NUM_STATES; ++source) { 208 for (int source = 0; source < NUM_STATES; ++source) {
209 for (int event = 0; event < NUM_EVENTS; ++event) { 209 for (int event = 0; event < NUM_EVENTS; ++event) {
210 EXPECT_NE(transition_table_[source][event], STATE_INVALID); 210 EXPECT_NE(transition_table_[source][event], STATE_INVALID);
211 EXPECT_GE(transition_table_[source][event], 0); 211 EXPECT_GE(transition_table_[source][event], 0);
212 EXPECT_LT(transition_table_[source][event], NUM_STATES); 212 EXPECT_LT(transition_table_[source][event], NUM_STATES);
213 } 213 }
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 << std::right << std::setw(2) 798 << std::right << std::setw(2)
799 << info.distance 799 << info.distance
800 << " }, // " 800 << " }, // "
801 << GetStateString(state2) << "\n"; 801 << GetStateString(state2) << "\n";
802 } 802 }
803 output << "},\n"; 803 output << "},\n";
804 } 804 }
805 output << "};"; 805 output << "};";
806 return output.str(); 806 return output.str();
807 } 807 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698