summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-30 22:59:43 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-30 22:59:43 +0000
commit6ce9560db08042fe9f40e060662ab456ce634c0e (patch)
treedcacb9d78429f301fb6cbc9c51861ff93c874dbf /chrome/test
parent013a19fa011abe89e5b65a697a762e8c9d41dab9 (diff)
downloadchromium_src-6ce9560db08042fe9f40e060662ab456ce634c0e.zip
chromium_src-6ce9560db08042fe9f40e060662ab456ce634c0e.tar.gz
chromium_src-6ce9560db08042fe9f40e060662ab456ce634c0e.tar.bz2
GTTF: Uncrashy memory_test.
It's still going to fail randomly, but at least shouldn't crrrrrash. TBR=huanr BUG=53882 TEST=memory_test Review URL: http://codereview.chromium.org/3248005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/memory_test/memory_test.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/test/memory_test/memory_test.cc b/chrome/test/memory_test/memory_test.cc
index 5024c9c..6d78d5e 100644
--- a/chrome/test/memory_test/memory_test.cc
+++ b/chrome/test/memory_test/memory_test.cc
@@ -137,8 +137,10 @@ class MemoryTest : public UIPerfTest {
// Cycle through the URLs.
scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(window.get());
int active_window = 0; // The index of the window we are currently using.
scoped_refptr<TabProxy> tab(window->GetActiveTab());
+ ASSERT_TRUE(tab.get());
int expected_tab_count = 1;
for (unsigned counter = 0; counter < urls_length; ++counter) {
std::string url = urls[counter];
@@ -160,12 +162,13 @@ class MemoryTest : public UIPerfTest {
expected_tab_count++;
WaitUntilTabCount(expected_tab_count);
tab = window->GetActiveTab();
- EXPECT_NE(tab, static_cast<TabProxy*>(NULL));
+ ASSERT_TRUE(tab.get());
continue;
}
int tab_index = counter % num_target_tabs; // A pseudo-random tab.
tab = window->GetTab(tab_index);
+ ASSERT_TRUE(tab.get());
}
if (url == "<NEXTTAB>") { // Special command to select the next tab.
@@ -174,7 +177,7 @@ class MemoryTest : public UIPerfTest {
EXPECT_TRUE(window->GetTabCount(&tab_count));
tab_index = (tab_index + 1) % tab_count;
tab = window->GetTab(tab_index);
- EXPECT_NE(tab, static_cast<TabProxy*>(NULL));
+ ASSERT_TRUE(tab.get());
continue;
}
@@ -198,8 +201,9 @@ class MemoryTest : public UIPerfTest {
active_window = window_count - 1;
window = automation()->GetBrowserWindow(active_window);
+ ASSERT_TRUE(window.get());
tab = window->GetActiveTab();
- EXPECT_NE(tab, static_cast<TabProxy*>(NULL));
+ ASSERT_TRUE(tab.get());
continue;
}
@@ -208,8 +212,9 @@ class MemoryTest : public UIPerfTest {
EXPECT_TRUE(automation()->GetBrowserWindowCount(&window_count));
active_window = (active_window + 1) % window_count;
window = automation()->GetBrowserWindow(active_window);
+ ASSERT_TRUE(window.get());
tab = window->GetActiveTab();
- EXPECT_NE(tab, static_cast<TabProxy*>(NULL));
+ ASSERT_TRUE(tab.get());
continue;
}