Home | History | Annotate | Download | only in tabs
      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
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/ui/tabs/tab_menu_model.h"
      6 
      7 #include "chrome/browser/ui/browser_commands.h"
      8 #include "chrome/test/base/browser_with_test_window_test.h"
      9 #include "chrome/test/base/menu_model_test.h"
     10 #include "testing/gtest/include/gtest/gtest.h"
     11 
     12 class TabMenuModelTest : public MenuModelTest,
     13                          public BrowserWithTestWindowTest {
     14 };
     15 
     16 TEST_F(TabMenuModelTest, Basics) {
     17   chrome::NewTab(browser());
     18   TabMenuModel model(&delegate_, browser()->tab_strip_model(), 0);
     19 
     20   // Verify it has items. The number varies by platform, so we don't check
     21   // the exact number.
     22   EXPECT_GT(model.GetItemCount(), 5);
     23 
     24   int item_count = 0;
     25   CountEnabledExecutable(&model, &item_count);
     26   EXPECT_GT(item_count, 0);
     27   EXPECT_EQ(item_count, delegate_.execute_count_);
     28   EXPECT_EQ(item_count, delegate_.enable_count_);
     29 }
     30