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

Side by Side Diff: chrome/test/data/webui/assertions-inl.h

Issue 7250009: Added guts to pull call signatures when assertions & expectations fail. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include constructed messages instead of just call signature. Created 9 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/chrome_web_ui.h"
6 #include "chrome/browser/ui/webui/test_chrome_web_ui_factory.h"
7 #include "googleurl/src/gurl.h"
8 #include "testing/gmock/include/gmock/gmock.h"
9
10 using ::testing::_;
11 using ::testing::Eq;
12 using ::testing::StrictMock;
13
14 // Dummy URL location for us to override.
15 const char kDummyURL[] = "chrome://DummyURL/";
16
17 // Returns a new WebUI object for the TabContents from |arg0|.
18 ACTION(ReturnNewWebUI) {
19 return new ChromeWebUI(arg0);
20 }
21
22 // Mock the TestChromeWebUIFactory::WebUIProvider to prove that we are called as
23 // expected.
24 class MockWebUIProvider : public TestChromeWebUIFactory::WebUIProvider {
25 public:
26 MOCK_METHOD2(NewWebUI, WebUI*(TabContents* tab_contents, const GURL& url));
27 };
28
29 class WebUIAssertionsTest : public WebUIBrowserTest {
30 public:
31 virtual void SetUpOnMainThread() OVERRIDE {
32 WebUIBrowserTest::SetUpOnMainThread();
33 TestChromeWebUIFactory::AddFactoryOverride(
34 GURL(kDummyURL).host(), &mock_provider_);
35 EXPECT_CALL(mock_provider_, NewWebUI(_, Eq(GURL(kDummyURL))))
36 .WillOnce(ReturnNewWebUI());
37 }
38 virtual void CleanUpOnMainThread() OVERRIDE {
39 WebUIBrowserTest::CleanUpOnMainThread();
40 TestChromeWebUIFactory::RemoveFactoryOverride(
41 GURL(kDummyURL).host());
42 }
43
44 StrictMock<MockWebUIProvider> mock_provider_;
45
46 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698