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

Unified Diff: chrome/browser/ui/views/crypto_module_password_dialog_view_unittest.cc

Issue 9956157: views: Make everything in crypto module password dialog private except the ctor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: peter view Created 8 years, 8 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/browser/ui/views/crypto_module_password_dialog_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/crypto_module_password_dialog_view_unittest.cc
diff --git a/chrome/browser/ui/views/crypto_module_password_dialog_view_unittest.cc b/chrome/browser/ui/views/crypto_module_password_dialog_view_unittest.cc
index e18e86759a7042869a40f6b3c0324c8e7dfe381a..b44d014afa9ec20049ff443e12720d83453ea628 100644
--- a/chrome/browser/ui/views/crypto_module_password_dialog_view_unittest.cc
+++ b/chrome/browser/ui/views/crypto_module_password_dialog_view_unittest.cc
@@ -1,50 +1,51 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/crypto_module_password_dialog_view.h"
+
#include <string>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/ui/crypto_module_password_dialog.h"
-#include "chrome/browser/ui/views/crypto_module_password_dialog_view.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/views/controls/textfield/textfield.h"
-std::string kSlotName = "slot";
-std::string kServer = "server";
-
namespace browser {
-CryptoModulePasswordReason kReason = kCryptoModulePasswordKeygen;
class CryptoModulePasswordDialogViewTest : public testing::Test {
public:
CryptoModulePasswordDialogViewTest() {}
~CryptoModulePasswordDialogViewTest() {}
+
void Capture(const char* text) {
text_ = text;
}
- void CreateDialogCrypto(const CryptoModulePasswordCallback& callback) {
- dialog_.reset(new CryptoModulePasswordDialogView(
- kSlotName, kReason, kServer, callback));
+
+ void CreateCryptoDialog(const CryptoModulePasswordCallback& callback) {
+ dialog_.reset(new CryptoModulePasswordDialogView("slot",
+ kCryptoModulePasswordKeygen, "server", callback));
}
- browser::CryptoModulePasswordCallback* callback_;
+
+ CryptoModulePasswordCallback* callback_;
std::string text_;
scoped_ptr<CryptoModulePasswordDialogView> dialog_;
};
TEST_F(CryptoModulePasswordDialogViewTest, TestAccept) {
- browser::CryptoModulePasswordCallback cb(
- base::Bind(&browser::CryptoModulePasswordDialogViewTest::Capture,
+ CryptoModulePasswordCallback cb(
+ base::Bind(&CryptoModulePasswordDialogViewTest::Capture,
base::Unretained(this)));
- CreateDialogCrypto(cb);
+ CreateCryptoDialog(cb);
EXPECT_EQ(dialog_->password_entry_, dialog_->GetInitiallyFocusedView());
EXPECT_TRUE(dialog_->GetModalType() != ui::MODAL_TYPE_NONE);
const std::string kPassword = "diAl0g";
- dialog_->password_entry_->SetText(UTF8ToUTF16(kPassword));
+ dialog_->password_entry_->SetText(ASCIIToUTF16(kPassword));
EXPECT_TRUE(dialog_->Accept());
EXPECT_EQ(kPassword, text_);
const string16 empty;
EXPECT_EQ(empty, dialog_->password_entry_->text());
}
+
} // namespace browser
« no previous file with comments | « chrome/browser/ui/views/crypto_module_password_dialog_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698