summaryrefslogtreecommitdiffstats
path: root/components/navigation_interception
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-15 10:58:55 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-15 10:58:55 +0000
commita8e69a745776e6226d2941e5947a8b7f0ce965d0 (patch)
tree03f14d1e78f92c04dbe8ec2a29d9c385edb06ae7 /components/navigation_interception
parentd43097897412d64ee7978c032842cc6ef12c415c (diff)
downloadchromium_src-a8e69a745776e6226d2941e5947a8b7f0ce965d0.zip
chromium_src-a8e69a745776e6226d2941e5947a8b7f0ce965d0.tar.gz
chromium_src-a8e69a745776e6226d2941e5947a8b7f0ce965d0.tar.bz2
Cleanup bits of components/navigation_interception.
Review URL: https://codereview.chromium.org/27151002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/navigation_interception')
-rw-r--r--components/navigation_interception/intercept_navigation_delegate.cc2
-rw-r--r--components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc16
2 files changed, 7 insertions, 11 deletions
diff --git a/components/navigation_interception/intercept_navigation_delegate.cc b/components/navigation_interception/intercept_navigation_delegate.cc
index 1cbe04c..2b126af 100644
--- a/components/navigation_interception/intercept_navigation_delegate.cc
+++ b/components/navigation_interception/intercept_navigation_delegate.cc
@@ -46,7 +46,7 @@ bool CheckIfShouldIgnoreNavigationOnUIThread(RenderViewHost* source,
return intercept_navigation_delegate->ShouldIgnoreNavigation(params);
}
-} // namespace
+} // namespace
// static
void InterceptNavigationDelegate::Associate(
diff --git a/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc b/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc
index e384501..3ac238c 100644
--- a/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc
+++ b/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc
@@ -5,7 +5,6 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/memory/scoped_ptr.h"
-#include "base/memory/scoped_vector.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "components/navigation_interception/intercept_navigation_resource_throttle.h"
@@ -57,7 +56,7 @@ MATCHER(NavigationParamsUrlIsSafe, "") {
return arg.url() != GURL(kUnsafeTestUrl);
}
-} // namespace
+} // namespace
// MockInterceptCallbackReceiver ----------------------------------------------
@@ -192,10 +191,8 @@ class InterceptNavigationResourceThrottleTest
if (web_contents())
web_contents()->SetDelegate(NULL);
- content::BrowserThread::PostTask(
- content::BrowserThread::IO,
- FROM_HERE,
- base::Bind(&base::DeletePointer<TestIOThreadState>, io_thread_state_));
+ content::BrowserThread::DeleteSoon(
+ content::BrowserThread::IO, FROM_HERE, io_thread_state_);
RenderViewHostTestHarness::TearDown();
}
@@ -234,7 +231,6 @@ class InterceptNavigationResourceThrottleTest
void SetUpWebContentsDelegateAndDrainRunLoop(
ShouldIgnoreNavigationCallbackAction callback_action,
bool* defer) {
-
ON_CALL(*mock_callback_receiver_, ShouldIgnoreNavigation(_, _))
.WillByDefault(Return(callback_action == IgnoreNavigation));
EXPECT_CALL(*mock_callback_receiver_,
@@ -280,7 +276,7 @@ TEST_F(InterceptNavigationResourceThrottleTest,
SetUpWebContentsDelegateAndDrainRunLoop(DontIgnoreNavigation, &defer);
EXPECT_TRUE(defer);
- EXPECT_TRUE(io_thread_state_);
+ ASSERT_TRUE(io_thread_state_);
EXPECT_TRUE(io_thread_state_->request_resumed());
}
@@ -290,7 +286,7 @@ TEST_F(InterceptNavigationResourceThrottleTest,
SetUpWebContentsDelegateAndDrainRunLoop(IgnoreNavigation, &defer);
EXPECT_TRUE(defer);
- EXPECT_TRUE(io_thread_state_);
+ ASSERT_TRUE(io_thread_state_);
EXPECT_TRUE(io_thread_state_->request_cancelled());
}
@@ -332,7 +328,7 @@ TEST_F(InterceptNavigationResourceThrottleTest,
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(defer);
- EXPECT_TRUE(io_thread_state_);
+ ASSERT_TRUE(io_thread_state_);
EXPECT_TRUE(io_thread_state_->request_resumed());
}