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

Side by Side Diff: chrome/browser/ui/tabs/tab_strip_model_unittest.cc

Issue 17382005: Unbreak tabs.onRemove extension API in face of fast tab closure Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't modify content Created 7 years, 6 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 | Annotate | Revision Log
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/tabs/tab_strip_model.h" 5 #include "chrome/browser/ui/tabs/tab_strip_model.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 State s(contents, to_index, MOVE); 298 State s(contents, to_index, MOVE);
299 s.src_index = from_index; 299 s.src_index = from_index;
300 states_.push_back(s); 300 states_.push_back(s);
301 } 301 }
302 302
303 virtual void TabClosingAt(TabStripModel* tab_strip_model, 303 virtual void TabClosingAt(TabStripModel* tab_strip_model,
304 WebContents* contents, 304 WebContents* contents,
305 int index) OVERRIDE { 305 int index) OVERRIDE {
306 states_.push_back(State(contents, index, CLOSE)); 306 states_.push_back(State(contents, index, CLOSE));
307 } 307 }
308 virtual void TabDetachedAt(WebContents* contents, int index) OVERRIDE { 308 virtual void TabDetachedAt(WebContents* contents,
309 int index,
310 bool closing_all) OVERRIDE {
309 states_.push_back(State(contents, index, DETACH)); 311 states_.push_back(State(contents, index, DETACH));
310 } 312 }
311 virtual void TabDeactivated(WebContents* contents) OVERRIDE { 313 virtual void TabDeactivated(WebContents* contents) OVERRIDE {
312 states_.push_back(State(contents, model()->active_index(), DEACTIVATE)); 314 states_.push_back(State(contents, model()->active_index(), DEACTIVATE));
313 } 315 }
314 virtual void TabChangedAt(WebContents* contents, 316 virtual void TabChangedAt(WebContents* contents,
315 int index, 317 int index,
316 TabChangeType change_type) OVERRIDE { 318 TabChangeType change_type) OVERRIDE {
317 states_.push_back(State(contents, index, CHANGE)); 319 states_.push_back(State(contents, index, CHANGE));
318 } 320 }
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 strip.ActivateTabAt(1, true); 2361 strip.ActivateTabAt(1, true);
2360 ASSERT_EQ(1, observer.GetStateCount()); 2362 ASSERT_EQ(1, observer.GetStateCount());
2361 State s(contents2, 1, MockTabStripModelObserver::SELECT); 2363 State s(contents2, 1, MockTabStripModelObserver::SELECT);
2362 s.src_contents = contents2; 2364 s.src_contents = contents2;
2363 s.src_index = 1; 2365 s.src_index = 1;
2364 s.change_reason = TabStripModelObserver::CHANGE_REASON_NONE; 2366 s.change_reason = TabStripModelObserver::CHANGE_REASON_NONE;
2365 EXPECT_TRUE(observer.StateEquals(0, s)); 2367 EXPECT_TRUE(observer.StateEquals(0, s));
2366 strip.RemoveObserver(&observer); 2368 strip.RemoveObserver(&observer);
2367 strip.CloseAllTabs(); 2369 strip.CloseAllTabs();
2368 } 2370 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698