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

Unified Diff: ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl_unittest.mm

Issue 2604773002: Create distiller files for Reading List. (Closed)
Patch Set: feedback Created 3 years, 12 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
Index: ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl_unittest.mm
diff --git a/ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl_unittest.mm b/ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl_unittest.mm
similarity index 82%
rename from ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl_unittest.mm
rename to ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl_unittest.mm
index 2c791eee774ea66682848abc3676d0cfa5ee15ae..5bdc290a308a4575ed7e131a1801b09c2d072b76 100644
--- a/ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl_unittest.mm
+++ b/ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl_unittest.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl.h"
+#import "ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl.h"
#include "base/memory/ptr_util.h"
#include "components/favicon/ios/web_favicon_driver.h"
@@ -13,7 +13,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
-namespace dom_distiller {
+namespace reading_list {
// Test class.
class FaviconWebStateDispatcherTest : public PlatformTest {
@@ -51,26 +51,26 @@ class TestFaviconWebStateDispatcherObserver : public web::WebStateObserver {
// Tests that RequestWebState returns a WebState with a FaviconDriver attached.
TEST_F(FaviconWebStateDispatcherTest, RequestWebState) {
FaviconWebStateDispatcherImpl dispatcher(GetBrowserState(), -1);
- web::WebState* web_state = dispatcher.RequestWebState();
+ std::unique_ptr<web::WebState> web_state = dispatcher.RequestWebState();
favicon::WebFaviconDriver* driver =
- favicon::WebFaviconDriver::FromWebState(web_state);
+ favicon::WebFaviconDriver::FromWebState(web_state.get());
EXPECT_NE(driver, nullptr);
}
// Tests that the WebState returned will be destroyed after a delay.
TEST_F(FaviconWebStateDispatcherTest, ReturnWebState) {
FaviconWebStateDispatcherImpl dispatcher(GetBrowserState(), 0);
- web::WebState* web_state = dispatcher.RequestWebState();
+ std::unique_ptr<web::WebState> web_state = dispatcher.RequestWebState();
- TestFaviconWebStateDispatcherObserver observer(web_state, this);
+ TestFaviconWebStateDispatcherObserver observer(web_state.get(), this);
ConditionBlock condition = ^{
return IsWebStateDestroyed();
};
- dispatcher.ReturnWebState(web_state);
+ dispatcher.ReturnWebState(std::move(web_state));
ASSERT_TRUE(testing::WaitUntilConditionOrTimeout(0.5, condition));
}
-} // namespace dom_distiller
+} // namespace reading_list

Powered by Google App Engine
This is Rietveld 408576698