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

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: clang 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
« no previous file with comments | « chrome/test/data/webui/assertions.js ('k') | chrome/test/data/webui/test_api.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 MockWebUIProvider();
27 ~MockWebUIProvider();
28
29 MOCK_METHOD2(NewWebUI, WebUI*(TabContents* tab_contents, const GURL& url));
30 };
31
32 class WebUIAssertionsTest : public WebUIBrowserTest {
33 public:
34 WebUIAssertionsTest();
35
36 virtual void SetUpOnMainThread() OVERRIDE {
37 WebUIBrowserTest::SetUpOnMainThread();
38 TestChromeWebUIFactory::AddFactoryOverride(
39 GURL(kDummyURL).host(), &mock_provider_);
40 EXPECT_CALL(mock_provider_, NewWebUI(_, Eq(GURL(kDummyURL))))
41 .WillOnce(ReturnNewWebUI());
42 }
43 virtual void CleanUpOnMainThread() OVERRIDE {
44 WebUIBrowserTest::CleanUpOnMainThread();
45 TestChromeWebUIFactory::RemoveFactoryOverride(
46 GURL(kDummyURL).host());
47 }
48
49 StrictMock<MockWebUIProvider> mock_provider_;
50
51 protected:
52 ~WebUIAssertionsTest();
53
54 private:
55 DISALLOW_COPY_AND_ASSIGN(WebUIAssertionsTest);
56 };
OLDNEW
« no previous file with comments | « chrome/test/data/webui/assertions.js ('k') | chrome/test/data/webui/test_api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698