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

Side by Side Diff: content/browser/tab_contents/tab_contents_delegate_unittest.cc

Issue 7480041: Adding session-only localStorage. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Misc test fixes, revolving around [Mock]ResourceContext. Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "chrome/test/testing_profile.h" 7 #include "chrome/test/testing_profile.h"
8 #include "content/browser/tab_contents/tab_contents.h" 8 #include "content/browser/tab_contents/tab_contents.h"
9 #include "content/browser/tab_contents/tab_contents_delegate.h" 9 #include "content/browser/tab_contents/tab_contents_delegate.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 virtual void CloseContents(TabContents* source) {} 47 virtual void CloseContents(TabContents* source) {}
48 48
49 virtual void MoveContents(TabContents* source, const gfx::Rect& pos) {} 49 virtual void MoveContents(TabContents* source, const gfx::Rect& pos) {}
50 50
51 virtual void UpdateTargetURL(TabContents* source, const GURL& url) {} 51 virtual void UpdateTargetURL(TabContents* source, const GURL& url) {}
52 }; 52 };
53 53
54 TEST(TabContentsDelegateTest, UnregisterInDestructor) { 54 TEST(TabContentsDelegateTest, UnregisterInDestructor) {
55 MessageLoop loop(MessageLoop::TYPE_UI); 55 MessageLoop loop(MessageLoop::TYPE_UI);
56 BrowserThread ui_thread(BrowserThread::UI, &loop);
56 scoped_ptr<MockTabContentsDelegate> delegate(new MockTabContentsDelegate()); 57 scoped_ptr<MockTabContentsDelegate> delegate(new MockTabContentsDelegate());
57 scoped_ptr<Profile> profile(new TestingProfile()); 58 scoped_ptr<Profile> profile(new TestingProfile());
58 scoped_ptr<TabContents> contents_a( 59 scoped_ptr<TabContents> contents_a(
59 new TabContents(profile.get(), NULL, 0, NULL, NULL)); 60 new TabContents(profile.get(), NULL, 0, NULL, NULL));
60 scoped_ptr<TabContents> contents_b( 61 scoped_ptr<TabContents> contents_b(
61 new TabContents(profile.get(), NULL, 0, NULL, NULL)); 62 new TabContents(profile.get(), NULL, 0, NULL, NULL));
62 EXPECT_TRUE(contents_a->delegate() == NULL); 63 EXPECT_TRUE(contents_a->delegate() == NULL);
63 EXPECT_TRUE(contents_b->delegate() == NULL); 64 EXPECT_TRUE(contents_b->delegate() == NULL);
64 65
65 // Setting a delegate should work correctly. 66 // Setting a delegate should work correctly.
(...skipping 25 matching lines...) Expand all
91 EXPECT_TRUE(contents_a->delegate() == NULL); 92 EXPECT_TRUE(contents_a->delegate() == NULL);
92 EXPECT_TRUE(contents_b->delegate() == NULL); 93 EXPECT_TRUE(contents_b->delegate() == NULL);
93 94
94 // Destroy the tab contents and run the message loop to prevent leaks. 95 // Destroy the tab contents and run the message loop to prevent leaks.
95 contents_a.reset(NULL); 96 contents_a.reset(NULL);
96 contents_b.reset(NULL); 97 contents_b.reset(NULL);
97 loop.RunAllPending(); 98 loop.RunAllPending();
98 } 99 }
99 100
100 } // namespace 101 } // namespace
OLDNEW
« content/browser/mock_resource_context.cc ('K') | « content/browser/resource_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698