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

Side by Side Diff: ash/screensaver/screensaver_view_unittest.cc

Issue 12093058: Screensaver implementation for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fixes. Created 7 years, 10 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 | « ash/screensaver/screensaver_view.cc ('k') | chrome/app/generated_resources.grd » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/screensaver/screensaver_view.h" 5 #include "ash/screensaver/screensaver_view.h"
6 6
7 #include "ash/test/ash_test_base.h" 7 #include "ash/test/ash_test_base.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "content/public/browser/browser_context.h" 9 #include "content/public/browser/browser_context.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 16 matching lines...) Expand all
27 virtual void SetUp() OVERRIDE { 27 virtual void SetUp() OVERRIDE {
28 AshTestBase::SetUp(); 28 AshTestBase::SetUp();
29 RunAllPendingInMessageLoop(); 29 RunAllPendingInMessageLoop();
30 } 30 }
31 31
32 void ExpectOpenScreensaver() { 32 void ExpectOpenScreensaver() {
33 internal::ScreensaverView* screensaver = 33 internal::ScreensaverView* screensaver =
34 internal::ScreensaverView::GetInstance(); 34 internal::ScreensaverView::GetInstance();
35 EXPECT_TRUE(screensaver != NULL); 35 EXPECT_TRUE(screensaver != NULL);
36 if (!screensaver) return; 36 if (!screensaver) return;
37 37 EXPECT_TRUE(screensaver->IsScreensaverShowingURL(url_));
38 EXPECT_TRUE(screensaver->screensaver_webview_ != NULL);
39 if (!screensaver->screensaver_webview_) return;
40
41 EXPECT_TRUE(screensaver->screensaver_webview_->web_contents() != NULL);
42 if (!screensaver->screensaver_webview_->web_contents()) return;
43
44 EXPECT_EQ(screensaver->screensaver_webview_->web_contents()->GetURL(),
45 url_);
46 } 38 }
47 39
48 void ExpectClosedScreensaver() { 40 void ExpectClosedScreensaver() {
49 EXPECT_TRUE(internal::ScreensaverView::GetInstance() == NULL); 41 EXPECT_TRUE(internal::ScreensaverView::GetInstance() == NULL);
50 } 42 }
51 43
52 protected: 44 protected:
53 GURL url_; 45 GURL url_;
54 46
55 private: 47 private:
(...skipping 24 matching lines...) Expand all
80 RunAllPendingInMessageLoop(); 72 RunAllPendingInMessageLoop();
81 73
82 ash::CloseScreensaver(); 74 ash::CloseScreensaver();
83 ExpectClosedScreensaver(); 75 ExpectClosedScreensaver();
84 ash::CloseScreensaver(); 76 ash::CloseScreensaver();
85 ExpectClosedScreensaver(); 77 ExpectClosedScreensaver();
86 } 78 }
87 79
88 } // namespace test 80 } // namespace test
89 } // namespace ash 81 } // namespace ash
OLDNEW
« no previous file with comments | « ash/screensaver/screensaver_view.cc ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698