1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "testing/gtest/include/gtest/gtest.h"
6
7#include "base/utf_string_conversions.h"
8#include "chrome/browser/browsing_data_indexed_db_helper.h"
9#include "chrome/test/testing_browser_process_test.h"
10#include "chrome/test/testing_profile.h"
11
12namespace {
13
14typedef TestingBrowserProcessTest CannedBrowsingDataIndexedDBHelperTest;
15
16TEST_F(CannedBrowsingDataIndexedDBHelperTest, Empty) {
17  TestingProfile profile;
18
19  const GURL origin("http://host1:1/");
20  const string16 description(ASCIIToUTF16("description"));
21
22  scoped_refptr<CannedBrowsingDataIndexedDBHelper> helper(
23      new CannedBrowsingDataIndexedDBHelper(&profile));
24
25  ASSERT_TRUE(helper->empty());
26  helper->AddIndexedDB(origin, description);
27  ASSERT_FALSE(helper->empty());
28  helper->Reset();
29  ASSERT_TRUE(helper->empty());
30}
31
32} // namespace
33