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

Side by Side Diff: chrome/browser/unload_browsertest.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 #if defined(OS_POSIX) 5 #if defined(OS_POSIX)
6 #include <signal.h> 6 #include <signal.h>
7 #endif 7 #endif
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 run_loop_(run_loop) { 454 run_loop_(run_loop) {
455 model_->AddObserver(this); 455 model_->AddObserver(this);
456 } 456 }
457 457
458 virtual ~FastTabCloseTabStripModelObserver() { 458 virtual ~FastTabCloseTabStripModelObserver() {
459 model_->RemoveObserver(this); 459 model_->RemoveObserver(this);
460 } 460 }
461 461
462 // TabStripModelObserver: 462 // TabStripModelObserver:
463 virtual void TabDetachedAt(content::WebContents* contents, 463 virtual void TabDetachedAt(content::WebContents* contents,
464 int index) OVERRIDE { 464 int index,
465 bool closing_all) OVERRIDE {
465 run_loop_->Quit(); 466 run_loop_->Quit();
466 } 467 }
467 468
468 private: 469 private:
469 TabStripModel* const model_; 470 TabStripModel* const model_;
470 base::RunLoop* const run_loop_; 471 base::RunLoop* const run_loop_;
471 }; 472 };
472 473
473 474
474 // Test that fast-tab-close works when closing a tab with an unload handler 475 // Test that fast-tab-close works when closing a tab with an unload handler
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 content::WindowedNotificationObserver window_observer( 612 content::WindowedNotificationObserver window_observer(
612 chrome::NOTIFICATION_BROWSER_CLOSED, 613 chrome::NOTIFICATION_BROWSER_CLOSED,
613 content::NotificationService::AllSources()); 614 content::NotificationService::AllSources());
614 chrome::CloseWindow(browser()); 615 chrome::CloseWindow(browser());
615 CrashTab(beforeunload_contents); 616 CrashTab(beforeunload_contents);
616 window_observer.Wait(); 617 window_observer.Wait();
617 } 618 }
618 619
619 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs 620 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs
620 // and multiple windows. 621 // and multiple windows.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698