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

Unified Diff: chrome/browser/cocoa/base_view_unittest.mm

Issue 2973004: [Mac]Implement ViewID support. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Turns out that, it's not a good solution. Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/base_view.mm ('k') | chrome/browser/cocoa/bookmark_bar_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/base_view_unittest.mm
diff --git a/chrome/browser/cocoa/base_view_unittest.mm b/chrome/browser/cocoa/base_view_unittest.mm
index bbfc75e04a28bbf24d46b239e0517c765a180841..82aeb8e78502ab5fdf3eb1f6d15b899d8ccb8c96 100644
--- a/chrome/browser/cocoa/base_view_unittest.mm
+++ b/chrome/browser/cocoa/base_view_unittest.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -7,6 +7,7 @@
#include "base/scoped_nsobject.h"
#import "chrome/browser/cocoa/base_view.h"
#import "chrome/browser/cocoa/cocoa_test_helper.h"
+#import "chrome/browser/cocoa/view_id_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -45,4 +46,16 @@ TEST_F(BaseViewTest, NSRectToRect) {
EXPECT_EQ(back_again.size.height, convert.size.height);
}
+TEST_F(BaseViewTest, Tag) {
+ [view_ setViewID:VIEW_ID_TAB_0];
+ EXPECT_EQ(VIEW_ID_TAB_0, [view_ viewID]);
+ EXPECT_EQ(view_id_util::ViewIDToTag(VIEW_ID_TAB_0), [view_ tag]);
+ EXPECT_EQ((NSView*)view_, view_id_util::GetView(test_window(), VIEW_ID_TAB_0));
+
+ [view_ setViewID:VIEW_ID_TOOLBAR];
+ EXPECT_EQ(VIEW_ID_TOOLBAR, [view_ viewID]);
+ EXPECT_EQ(view_id_util::ViewIDToTag(VIEW_ID_TOOLBAR), [view_ tag]);
+ EXPECT_EQ((NSView*)view_, view_id_util::GetView(test_window(), VIEW_ID_TOOLBAR));
+}
+
} // namespace
« no previous file with comments | « chrome/browser/cocoa/base_view.mm ('k') | chrome/browser/cocoa/bookmark_bar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698