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

Unified Diff: chrome_frame/test/ready_mode_unittest.cc

Issue 6314016: Update the Ready Mode UI in response to feedback from UI leads, Chrome Frame ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/ready_mode/ready_mode.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/ready_mode_unittest.cc
===================================================================
--- chrome_frame/test/ready_mode_unittest.cc (revision 72333)
+++ chrome_frame/test/ready_mode_unittest.cc (working copy)
@@ -18,6 +18,7 @@
#include "chrome_frame/ready_mode/internal/ready_prompt_content.h"
#include "chrome_frame/ready_mode/internal/ready_prompt_window.h"
#include "chrome_frame/ready_mode/internal/registry_ready_mode_state.h"
+#include "chrome_frame/ready_mode/internal/url_launcher.h"
#include "chrome_frame/simple_resource_loader.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
@@ -97,6 +98,12 @@
MOCK_METHOD0(AcceptChromeFrame, void(void));
}; // class MockReadyModeState
+class MockUrlLauncher : public UrlLauncher {
+ public:
+ // UrlLauncher implementation
+ MOCK_METHOD1(LaunchUrl, void(const std::wstring& url));
+}; // class MockUrlLauncher
+
} // namespace
class ReadyPromptTest : public testing::Test {
@@ -126,9 +133,11 @@
// owned by ReadyPromptWindow
state_ = new MockReadyModeState();
- ready_prompt_window_ = (new ReadyPromptWindow())->Initialize(&frame_,
- state_);
+ url_launcher_ = new MockUrlLauncher();
+ ready_prompt_window_ = ReadyPromptWindow::CreateInstance(
+ &frame_, state_, url_launcher_);
+
ASSERT_TRUE(ready_prompt_window_ != NULL);
RECT position = {0, 0, 800, 39};
ASSERT_TRUE(ready_prompt_window_->SetWindowPos(HWND_TOP, &position,
@@ -137,6 +146,7 @@
protected:
MockReadyModeState* state_;
+ MockUrlLauncher* url_launcher_;
base::WeakPtr<ReadyPromptWindow> ready_prompt_window_;
}; // class ReadyPromptWindowTest
@@ -212,8 +222,11 @@
TEST_F(ReadyPromptTest, ReadyPromptContentTest) {
// owned by ReadyPromptContent
MockReadyModeState* state = new MockReadyModeState();
- scoped_ptr<ReadyPromptContent> content_(new ReadyPromptContent(state));
+ MockUrlLauncher* url_launcher = new MockUrlLauncher();
+ scoped_ptr<ReadyPromptContent> content_(new ReadyPromptContent(state,
+ url_launcher));
+
content_->InstallInFrame(&frame_);
// Ensure that, if a child is created, it is not visible yet.
@@ -255,21 +268,15 @@
ready_prompt_window_->DestroyWindow();
}
-TEST_F(ReadyPromptWindowButtonTest, ClickYes) {
+TEST_F(ReadyPromptWindowButtonTest, ClickEnable) {
EXPECT_CALL(*state_, AcceptChromeFrame());
- ASSERT_TRUE(ClickOnCaption(L"&Yes"));
+ ASSERT_TRUE(ClickOnCaption(L"Enable"));
RunUntilCloseInfobar();
}
-TEST_F(ReadyPromptWindowButtonTest, ClickRemindMeLater) {
- EXPECT_CALL(*state_, TemporarilyDeclineChromeFrame());
- ASSERT_TRUE(ClickOnCaption(L"Remind me &Later"));
- RunUntilCloseInfobar();
-}
-
-TEST_F(ReadyPromptWindowButtonTest, ClickNo) {
+TEST_F(ReadyPromptWindowButtonTest, ClickIgnore) {
EXPECT_CALL(*state_, PermanentlyDeclineChromeFrame());
- ASSERT_TRUE(ClickOnCaption(L"&No"));
+ ASSERT_TRUE(ClickOnCaption(L"Ignore"));
RunUntilCloseInfobar();
}
« no previous file with comments | « chrome_frame/ready_mode/ready_mode.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698