summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 20:21:36 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 20:21:36 +0000
commit08d87dcc005057164d9cc19ddba5ddda77ce4942 (patch)
tree946e480c2d6cf664288142c10f08b23737999fe5 /chrome
parent3eb07da6e868e49e28cb5a6d8a57037f2c45a20e (diff)
downloadchromium_src-08d87dcc005057164d9cc19ddba5ddda77ce4942.zip
chromium_src-08d87dcc005057164d9cc19ddba5ddda77ce4942.tar.gz
chromium_src-08d87dcc005057164d9cc19ddba5ddda77ce4942.tar.bz2
[Mac] Enable some left-behind unit tests.
NavicationControllerTest, TaskManagerTest and BackFwdMenuModelTest. BUG=none TEST=none Review URL: http://codereview.chromium.org/557063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/tab_contents/navigation_controller_unittest.cc8
-rw-r--r--chrome/browser/task_manager_unittest.cc15
-rwxr-xr-xchrome/chrome_tests.gypi3
3 files changed, 14 insertions, 12 deletions
diff --git a/chrome/browser/tab_contents/navigation_controller_unittest.cc b/chrome/browser/tab_contents/navigation_controller_unittest.cc
index 86b6da1..ea6a8c3 100644
--- a/chrome/browser/tab_contents/navigation_controller_unittest.cc
+++ b/chrome/browser/tab_contents/navigation_controller_unittest.cc
@@ -142,8 +142,6 @@ void RegisterForAllNavNotifications(TestNotificationTracker* tracker,
Source<NavigationController>(controller));
}
-} // namespace
-
// -----------------------------------------------------------------------------
TEST_F(NavigationControllerTest, Defaults) {
@@ -1106,8 +1104,6 @@ TEST_F(NavigationControllerTest, InPage) {
controller().GetActiveEntry()->url());
}
-namespace {
-
// NotificationObserver implementation used in verifying we've received the
// NotificationType::NAV_LIST_PRUNED method.
class PrunedListener : public NotificationObserver {
@@ -1139,8 +1135,6 @@ class PrunedListener : public NotificationObserver {
DISALLOW_COPY_AND_ASSIGN(PrunedListener);
};
-} // namespace
-
// Tests that we limit the number of navigation entries created correctly.
TEST_F(NavigationControllerTest, EnforceMaxNavigationCount) {
size_t original_count = NavigationController::max_entry_count();
@@ -1617,3 +1611,5 @@ TEST_F(NavigationControllerHistoryTest, NavigationPruning) {
windows_[0]->tabs[0]->navigations[1]);
}
*/
+
+} // namespace
diff --git a/chrome/browser/task_manager_unittest.cc b/chrome/browser/task_manager_unittest.cc
index 0961b6d..d586a5c 100644
--- a/chrome/browser/task_manager_unittest.cc
+++ b/chrome/browser/task_manager_unittest.cc
@@ -16,6 +16,15 @@
namespace {
+#if defined(OS_MACOSX)
+// From task_manager.cc:
+// Activity Monitor shows %cpu with one decimal digit -- be
+// consistent with that.
+const wchar_t *kZeroCPUUsage = L"0.0";
+#else
+const wchar_t *kZeroCPUUsage = L"0";
+#endif
+
class TestResource : public TaskManager::Resource {
public:
TestResource() : refresh_called_(false) {}
@@ -60,7 +69,7 @@ TEST_F(TaskManagerTest, Resources) {
EXPECT_STREQ(L"test title", model->GetResourceTitle(0).c_str());
EXPECT_STREQ(l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT).c_str(),
model->GetResourceNetworkUsage(0).c_str());
- EXPECT_STREQ(L"0", model->GetResourceCPUUsage(0).c_str());
+ EXPECT_STREQ(kZeroCPUUsage, model->GetResourceCPUUsage(0).c_str());
task_manager.AddResource(&resource2); // Will be in the same group.
ASSERT_EQ(2, model->ResourceCount());
@@ -69,7 +78,7 @@ TEST_F(TaskManagerTest, Resources) {
EXPECT_STREQ(L"test title", model->GetResourceTitle(1).c_str());
EXPECT_STREQ(l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT).c_str(),
model->GetResourceNetworkUsage(1).c_str());
- EXPECT_STREQ(L"0", model->GetResourceCPUUsage(1).c_str());
+ EXPECT_STREQ(kZeroCPUUsage, model->GetResourceCPUUsage(1).c_str());
task_manager.RemoveResource(&resource1);
// Now resource2 will be first in group.
@@ -78,7 +87,7 @@ TEST_F(TaskManagerTest, Resources) {
EXPECT_STREQ(L"test title", model->GetResourceTitle(0).c_str());
EXPECT_STREQ(l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT).c_str(),
model->GetResourceNetworkUsage(0).c_str());
- EXPECT_STREQ(L"0", model->GetResourceCPUUsage(0).c_str());
+ EXPECT_STREQ(kZeroCPUUsage, model->GetResourceCPUUsage(0).c_str());
task_manager.RemoveResource(&resource2);
EXPECT_EQ(0, model->ResourceCount());
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index e77daa5..3b8f6c0 100755
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -950,11 +950,8 @@
],
'sources!': [
'browser/views/bookmark_context_menu_test.cc',
- 'browser/back_forward_menu_model_unittest.cc',
'browser/gtk/go_button_gtk_unittest.cc',
'browser/gtk/tabs/tab_renderer_gtk_unittest.cc',
- 'browser/tab_contents/navigation_controller_unittest.cc',
- 'browser/task_manager_unittest.cc',
'../third_party/hunspell/google/hunspell_tests.cc',
],
# TODO(mark): We really want this for all non-static library targets,