Lines Matching refs:delegate
30 scoped_ptr<MockWebContentsDelegate> delegate(new MockWebContentsDelegate());
32 // Setting a delegate should work correctly.
33 contents_a->SetDelegate(delegate.get());
34 EXPECT_EQ(delegate.get(), contents_a->GetDelegate());
37 // A delegate can be a delegate to multiple WebContentsImpl.
38 contents_b->SetDelegate(delegate.get());
39 EXPECT_EQ(delegate.get(), contents_a->GetDelegate());
40 EXPECT_EQ(delegate.get(), contents_b->GetDelegate());
42 // Setting the same delegate multiple times should work correctly.
43 contents_b->SetDelegate(delegate.get());
44 EXPECT_EQ(delegate.get(), contents_a->GetDelegate());
45 EXPECT_EQ(delegate.get(), contents_b->GetDelegate());
47 // Setting delegate to NULL should work correctly.
49 EXPECT_EQ(delegate.get(), contents_a->GetDelegate());
52 // Destroying the delegate while it is still the delegate for a
54 contents_b->SetDelegate(delegate.get());
55 EXPECT_EQ(delegate.get(), contents_a->GetDelegate());
56 EXPECT_EQ(delegate.get(), contents_b->GetDelegate());
57 delegate.reset(NULL);