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

Side by Side Diff: chrome/renderer/render_widget_unittest.cc

Issue 50081: Free unit tests for Mac: BookmarkHTMLWriterTest, BookmarkUtilsTest, (Closed)
Patch Set: Created 11 years, 9 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 | « chrome/chrome.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include "base/ref_counted.h" 7 #include "base/ref_counted.h"
8 #include "chrome/renderer/mock_render_process.h" 8 #include "chrome/renderer/mock_render_process.h"
9 #include "chrome/renderer/mock_render_thread.h" 9 #include "chrome/renderer/mock_render_thread.h"
10 #include "chrome/renderer/render_widget.h" 10 #include "chrome/renderer/render_widget.h"
(...skipping 23 matching lines...) Expand all
34 ASSERT_TRUE(widget_); 34 ASSERT_TRUE(widget_);
35 } 35 }
36 virtual void TearDown() { 36 virtual void TearDown() {
37 widget_ = NULL; 37 widget_ = NULL;
38 mock_process_.reset(); 38 mock_process_.reset();
39 } 39 }
40 40
41 scoped_ptr<MockProcess> mock_process_; 41 scoped_ptr<MockProcess> mock_process_;
42 }; 42 };
43 43
44 } // namespace
45
46 TEST_F(RenderWidgetTest, CreateAndCloseWidget) { 44 TEST_F(RenderWidgetTest, CreateAndCloseWidget) {
47 // After the RenderWidget it must have sent a message to the render thread 45 // After the RenderWidget it must have sent a message to the render thread
48 // that sets the opener id. 46 // that sets the opener id.
49 EXPECT_EQ(kOpenerId, render_thread_.opener_id()); 47 EXPECT_EQ(kOpenerId, render_thread_.opener_id());
50 ASSERT_TRUE(render_thread_.has_widget()); 48 ASSERT_TRUE(render_thread_.has_widget());
51 49
52 // Now simulate a close of the Widget. 50 // Now simulate a close of the Widget.
53 render_thread_.SendCloseMessage(); 51 render_thread_.SendCloseMessage();
54 EXPECT_FALSE(render_thread_.has_widget()); 52 EXPECT_FALSE(render_thread_.has_widget());
55 53
56 // Run the loop so the release task from the renderwidget executes. 54 // Run the loop so the release task from the renderwidget executes.
57 msg_loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask()); 55 msg_loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask());
58 msg_loop_.Run(); 56 msg_loop_.Run();
59 } 57 }
58
59 } // namespace
OLDNEW
« no previous file with comments | « chrome/chrome.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698