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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_unittest.cc

Issue 3386014: This adds some plumbing for propagating the status and error code of a (Closed)
Patch Set: Fixed Mac code to handle both SEGV and BUS Created 10 years, 3 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "app/keyboard_codes.h" 5 #include "app/keyboard_codes.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "base/shared_memory.h" 8 #include "base/shared_memory.h"
9 #include "base/timer.h" 9 #include "base/timer.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 view_->set_bounds(original_size); 385 view_->set_bounds(original_size);
386 host_->WasResized(); 386 host_->WasResized();
387 EXPECT_TRUE(host_->resize_ack_pending_); 387 EXPECT_TRUE(host_->resize_ack_pending_);
388 EXPECT_EQ(original_size.size(), host_->in_flight_size_); 388 EXPECT_EQ(original_size.size(), host_->in_flight_size_);
389 EXPECT_TRUE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID)); 389 EXPECT_TRUE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID));
390 390
391 // Simulate a renderer crash before the update message. Ensure all the 391 // Simulate a renderer crash before the update message. Ensure all the
392 // resize ack logic is cleared. Must clear the view first so it doesn't get 392 // resize ack logic is cleared. Must clear the view first so it doesn't get
393 // deleted. 393 // deleted.
394 host_->set_view(NULL); 394 host_->set_view(NULL);
395 host_->RendererExited(); 395 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1);
396 EXPECT_FALSE(host_->resize_ack_pending_); 396 EXPECT_FALSE(host_->resize_ack_pending_);
397 EXPECT_EQ(gfx::Size(), host_->in_flight_size_); 397 EXPECT_EQ(gfx::Size(), host_->in_flight_size_);
398 398
399 // Reset the view so we can exit the test cleanly. 399 // Reset the view so we can exit the test cleanly.
400 host_->set_view(view_.get()); 400 host_->set_view(view_.get());
401 } 401 }
402 402
403 // Tests setting custom background 403 // Tests setting custom background
404 TEST_F(RenderWidgetHostTest, Background) { 404 TEST_F(RenderWidgetHostTest, Background) {
405 #if defined(OS_WIN) || defined(OS_LINUX) 405 #if defined(OS_WIN) || defined(OS_LINUX)
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 // Start it again to ensure it still works. 699 // Start it again to ensure it still works.
700 EXPECT_FALSE(host_->unresponsive_timer_fired()); 700 EXPECT_FALSE(host_->unresponsive_timer_fired());
701 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); 701 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10));
702 702
703 // Wait long enough for first timeout and see if it fired. 703 // Wait long enough for first timeout and see if it fired.
704 MessageLoop::current()->PostDelayedTask(FROM_HERE, 704 MessageLoop::current()->PostDelayedTask(FROM_HERE,
705 new MessageLoop::QuitTask(), 10); 705 new MessageLoop::QuitTask(), 10);
706 MessageLoop::current()->Run(); 706 MessageLoop::current()->Run();
707 EXPECT_TRUE(host_->unresponsive_timer_fired()); 707 EXPECT_TRUE(host_->unresponsive_timer_fired());
708 } 708 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host.cc ('k') | chrome/browser/renderer_host/render_widget_host_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698