chromium/content/browser/renderer_host/navigation_entry_impl_unittest.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/renderer_host/navigation_entry_impl.h"

#include <memory>
#include <string>
#include <utility>

#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/test_file_util.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "content/browser/renderer_host/navigation_entry_restore_context_impl.h"
#include "content/browser/site_instance_impl.h"
#include "content/public/browser/ssl_status.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/page_state/page_state_serialization.h"

ASCIIToUTF16;

namespace content {

namespace {

blink::PageState CreateTestPageState() {}

}  // namespace

class NavigationEntryTest : public testing::Test {};

// Test unique ID accessors
TEST_F(NavigationEntryTest, NavigationEntryUniqueIDs) {}

// Test URL accessors
TEST_F(NavigationEntryTest, NavigationEntryURLs) {}

// Test Favicon inner class construction.
TEST_F(NavigationEntryTest, NavigationEntryFavicons) {}

// Test SSLStatus inner class
TEST_F(NavigationEntryTest, NavigationEntrySSLStatus) {}

// Test other basic accessors
TEST_F(NavigationEntryTest, NavigationEntryAccessors) {}

// Test basic Clone behavior.
TEST_F(NavigationEntryTest, NavigationEntryClone) {}

// Test timestamps.
TEST_F(NavigationEntryTest, NavigationEntryTimestamps) {}

TEST_F(NavigationEntryTest, SetPageStateWithCorruptedSequenceNumbers) {}

TEST_F(NavigationEntryTest, SetPageStateWithDefaultSequenceNumbers) {}

#if BUILDFLAG(IS_ANDROID)
// Failing test, see crbug/1050906.
// Test that content URIs correctly show the file display name as the title.
TEST_F(NavigationEntryTest, DISABLED_NavigationEntryContentUri) {
  base::FilePath image_path;
  EXPECT_TRUE(
      base::PathService::Get(base::DIR_SRC_TEST_DATA_ROOT, &image_path));
  image_path = image_path.Append(FILE_PATH_LITERAL("content"));
  image_path = image_path.Append(FILE_PATH_LITERAL("test"));
  image_path = image_path.Append(FILE_PATH_LITERAL("data"));
  image_path = image_path.Append(FILE_PATH_LITERAL("blank.jpg"));
  EXPECT_TRUE(base::PathExists(image_path));

  base::FilePath content_uri = base::InsertImageIntoMediaStore(image_path);

  entry1_->SetURL(GURL(content_uri.value()));
  EXPECT_EQ(u"blank.jpg", entry1_->GetTitleForDisplay());
}
#endif

}  // namespace content