diff options
author | sdefresne <sdefresne@chromium.org> | 2015-04-30 00:51:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-30 07:51:49 +0000 |
commit | b0d0862fbba45d4ff85b2362d68d4e03ffe41501 (patch) | |
tree | e1bd4b9185f94e16e93a1fd91a97640cca6fa4ad /components/test | |
parent | f973fd69016af19106e5b26a9f272995549d7e31 (diff) | |
download | chromium_src-b0d0862fbba45d4ff85b2362d68d4e03ffe41501.zip chromium_src-b0d0862fbba45d4ff85b2362d68d4e03ffe41501.tar.gz chromium_src-b0d0862fbba45d4ff85b2362d68d4e03ffe41501.tar.bz2 |
[History] Componentize history_unittest.cc
Split history_unittest.cc in three according to what is tested and on
the dependencies:
- content_history_backend_unittest.cc
- history_backend_unittest.cc
- history_service_unittest.cc
BUG=370850
Review URL: https://codereview.chromium.org/1101383002
Cr-Commit-Position: refs/heads/master@{#327677}
Diffstat (limited to 'components/test')
-rw-r--r-- | components/test/data/history/archived_history.4.sql | 17 | ||||
-rw-r--r-- | components/test/data/history/history.22.sql | 27 | ||||
-rw-r--r-- | components/test/data/history/history.26.sql | 26 | ||||
-rw-r--r-- | components/test/data/history/history.27.sql | 25 | ||||
-rw-r--r-- | components/test/data/history/history.28.sql | 25 |
5 files changed, 120 insertions, 0 deletions
diff --git a/components/test/data/history/archived_history.4.sql b/components/test/data/history/archived_history.4.sql new file mode 100644 index 0000000..41eb908 --- /dev/null +++ b/components/test/data/history/archived_history.4.sql @@ -0,0 +1,17 @@ +PRAGMA foreign_keys=OFF; +BEGIN TRANSACTION; +CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); +INSERT INTO "meta" VALUES('version','4'); +INSERT INTO "meta" VALUES('last_compatible_version','2'); +CREATE TABLE urls(id INTEGER PRIMARY KEY,url LONGVARCHAR,title LONGVARCHAR,visit_count INTEGER DEFAULT 0 NOT NULL,typed_count INTEGER DEFAULT 0 NOT NULL,last_visit_time INTEGER NOT NULL,hidden INTEGER DEFAULT 0 NOT NULL,favicon_id INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE visits(id INTEGER PRIMARY KEY,url INTEGER NOT NULL,visit_time INTEGER NOT NULL,from_visit INTEGER,transition INTEGER DEFAULT 0 NOT NULL,segment_id INTEGER,visit_duration INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE visit_source(id INTEGER PRIMARY KEY,source INTEGER NOT NULL); +CREATE TABLE keyword_search_terms (keyword_id INTEGER NOT NULL,url_id INTEGER NOT NULL,lower_term LONGVARCHAR NOT NULL,term LONGVARCHAR NOT NULL); +CREATE INDEX visits_url_index ON visits (url); +CREATE INDEX visits_from_index ON visits (from_visit); +CREATE INDEX visits_time_index ON visits (visit_time); +CREATE INDEX urls_url_index ON urls (url); +CREATE INDEX keyword_search_terms_index1 ON keyword_search_terms (keyword_id, lower_term); +CREATE INDEX keyword_search_terms_index2 ON keyword_search_terms (url_id); +CREATE INDEX keyword_search_terms_index3 ON keyword_search_terms (term); +COMMIT; diff --git a/components/test/data/history/history.22.sql b/components/test/data/history/history.22.sql new file mode 100644 index 0000000..49429d9 --- /dev/null +++ b/components/test/data/history/history.22.sql @@ -0,0 +1,27 @@ +PRAGMA foreign_keys=OFF; +BEGIN TRANSACTION; +CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); +INSERT INTO "meta" VALUES('last_compatible_version','16'); +INSERT INTO "meta" VALUES('version','22'); +INSERT INTO "meta" VALUES('next_download_id','2'); +INSERT INTO "meta" VALUES('early_expiration_threshold','12995946566765618'); +CREATE TABLE urls(id INTEGER PRIMARY KEY,url LONGVARCHAR,title LONGVARCHAR,visit_count INTEGER DEFAULT 0 NOT NULL,typed_count INTEGER DEFAULT 0 NOT NULL,last_visit_time INTEGER NOT NULL,hidden INTEGER DEFAULT 0 NOT NULL,favicon_id INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE visits(id INTEGER PRIMARY KEY,url INTEGER NOT NULL,visit_time INTEGER NOT NULL,from_visit INTEGER,transition INTEGER DEFAULT 0 NOT NULL,segment_id INTEGER,is_indexed BOOLEAN,visit_duration INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE visit_source(id INTEGER PRIMARY KEY,source INTEGER NOT NULL); +CREATE TABLE keyword_search_terms (keyword_id INTEGER NOT NULL,url_id INTEGER NOT NULL,lower_term LONGVARCHAR NOT NULL,term LONGVARCHAR NOT NULL); +CREATE TABLE downloads (id INTEGER PRIMARY KEY,full_path LONGVARCHAR NOT NULL,url LONGVARCHAR NOT NULL,start_time INTEGER NOT NULL,received_bytes INTEGER NOT NULL,total_bytes INTEGER NOT NULL,state INTEGER NOT NULL,end_time INTEGER NOT NULL,opened INTEGER NOT NULL); +CREATE TABLE segments (id INTEGER PRIMARY KEY,name VARCHAR,url_id INTEGER NON NULL,pres_index INTEGER DEFAULT -1 NOT NULL); +CREATE TABLE segment_usage (id INTEGER PRIMARY KEY,segment_id INTEGER NOT NULL,time_slot INTEGER NOT NULL,visit_count INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE presentation(url_id INTEGER PRIMARY KEY,pres_index INTEGER NOT NULL); +CREATE INDEX visits_url_index ON visits (url); +CREATE INDEX visits_from_index ON visits (from_visit); +CREATE INDEX visits_time_index ON visits (visit_time); +CREATE INDEX segments_name ON segments(name); +CREATE INDEX segments_url_id ON segments(url_id); +CREATE INDEX segment_usage_time_slot_segment_id ON segment_usage(time_slot, segment_id); +CREATE INDEX segments_usage_seg_id ON segment_usage(segment_id); +CREATE INDEX urls_url_index ON urls (url); +CREATE INDEX keyword_search_terms_index1 ON keyword_search_terms (keyword_id, lower_term); +CREATE INDEX keyword_search_terms_index2 ON keyword_search_terms (url_id); +CREATE INDEX keyword_search_terms_index3 ON keyword_search_terms (term); +COMMIT; diff --git a/components/test/data/history/history.26.sql b/components/test/data/history/history.26.sql new file mode 100644 index 0000000..6d4717f --- /dev/null +++ b/components/test/data/history/history.26.sql @@ -0,0 +1,26 @@ +PRAGMA foreign_keys=OFF; +BEGIN TRANSACTION; +CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); +INSERT INTO "meta" VALUES('last_compatible_version','16'); +INSERT INTO "meta" VALUES('version','26'); +INSERT INTO "meta" VALUES('early_expiration_threshold','12995946566765618'); +CREATE TABLE urls(id INTEGER PRIMARY KEY,url LONGVARCHAR,title LONGVARCHAR,visit_count INTEGER DEFAULT 0 NOT NULL,typed_count INTEGER DEFAULT 0 NOT NULL,last_visit_time INTEGER NOT NULL,hidden INTEGER DEFAULT 0 NOT NULL,favicon_id INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE visits(id INTEGER PRIMARY KEY,url INTEGER NOT NULL,visit_time INTEGER NOT NULL,from_visit INTEGER,transition INTEGER DEFAULT 0 NOT NULL,segment_id INTEGER,is_indexed BOOLEAN,visit_duration INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE visit_source(id INTEGER PRIMARY KEY,source INTEGER NOT NULL); +CREATE TABLE keyword_search_terms (keyword_id INTEGER NOT NULL,url_id INTEGER NOT NULL,lower_term LONGVARCHAR NOT NULL,term LONGVARCHAR NOT NULL); +CREATE TABLE downloads (id INTEGER PRIMARY KEY,current_path LONGVARCHAR NOT NULL,target_path LONGVARCHAR NOT NULL,start_time INTEGER NOT NULL,received_bytes INTEGER NOT NULL,total_bytes INTEGER NOT NULL,state INTEGER NOT NULL,danger_type INTEGER NOT NULL,interrupt_reason INTEGER NOT NULL,end_time INTEGER NOT NULL,opened INTEGER NOT NULL,referrer VARCHAR NOT NULL); +CREATE TABLE downloads_url_chains (id INTEGER NOT NULL,chain_index INTEGER NOT NULL,url LONGVARCHAR NOT NULL,PRIMARY KEY (id, chain_index) ); +CREATE TABLE segments (id INTEGER PRIMARY KEY,name VARCHAR,url_id INTEGER NON NULL); +CREATE TABLE segment_usage (id INTEGER PRIMARY KEY,segment_id INTEGER NOT NULL,time_slot INTEGER NOT NULL,visit_count INTEGER DEFAULT 0 NOT NULL); +CREATE INDEX visits_url_index ON visits (url); +CREATE INDEX visits_from_index ON visits (from_visit); +CREATE INDEX visits_time_index ON visits (visit_time); +CREATE INDEX segments_name ON segments(name); +CREATE INDEX segments_url_id ON segments(url_id); +CREATE INDEX segment_usage_time_slot_segment_id ON segment_usage(time_slot, segment_id); +CREATE INDEX segments_usage_seg_id ON segment_usage(segment_id); +CREATE INDEX urls_url_index ON urls (url); +CREATE INDEX keyword_search_terms_index1 ON keyword_search_terms (keyword_id, lower_term); +CREATE INDEX keyword_search_terms_index2 ON keyword_search_terms (url_id); +CREATE INDEX keyword_search_terms_index3 ON keyword_search_terms (term); +COMMIT; diff --git a/components/test/data/history/history.27.sql b/components/test/data/history/history.27.sql new file mode 100644 index 0000000..0ceb880 --- /dev/null +++ b/components/test/data/history/history.27.sql @@ -0,0 +1,25 @@ +PRAGMA foreign_keys=OFF; +BEGIN TRANSACTION; +CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); +INSERT INTO "meta" VALUES('version','27'); +INSERT INTO "meta" VALUES('last_compatible_version','16'); +CREATE TABLE urls(id INTEGER PRIMARY KEY,url LONGVARCHAR,title LONGVARCHAR,visit_count INTEGER DEFAULT 0 NOT NULL,typed_count INTEGER DEFAULT 0 NOT NULL,last_visit_time INTEGER NOT NULL,hidden INTEGER DEFAULT 0 NOT NULL,favicon_id INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE visits(id INTEGER PRIMARY KEY,url INTEGER NOT NULL,visit_time INTEGER NOT NULL,from_visit INTEGER,transition INTEGER DEFAULT 0 NOT NULL,segment_id INTEGER,visit_duration INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE visit_source(id INTEGER PRIMARY KEY,source INTEGER NOT NULL); +CREATE TABLE keyword_search_terms (keyword_id INTEGER NOT NULL,url_id INTEGER NOT NULL,lower_term LONGVARCHAR NOT NULL,term LONGVARCHAR NOT NULL); +CREATE TABLE downloads (id INTEGER PRIMARY KEY,current_path LONGVARCHAR NOT NULL,target_path LONGVARCHAR NOT NULL,start_time INTEGER NOT NULL,received_bytes INTEGER NOT NULL,total_bytes INTEGER NOT NULL,state INTEGER NOT NULL,danger_type INTEGER NOT NULL, interrupt_reason INTEGER NOT NULL,end_time INTEGER NOT NULL,opened INTEGER NOT NULL,referrer VARCHAR NOT NULL,by_ext_id VARCHAR NOT NULL,by_ext_name VARCHAR NOT NULL); +CREATE TABLE downloads_url_chains (id INTEGER NOT NULL,chain_index INTEGER NOT NULL,url LONGVARCHAR NOT NULL, PRIMARY KEY (id, chain_index) ); +CREATE TABLE segments (id INTEGER PRIMARY KEY,name VARCHAR,url_id INTEGER NON NULL); +CREATE TABLE segment_usage (id INTEGER PRIMARY KEY,segment_id INTEGER NOT NULL,time_slot INTEGER NOT NULL,visit_count INTEGER DEFAULT 0 NOT NULL); +CREATE INDEX visits_url_index ON visits (url); +CREATE INDEX visits_from_index ON visits (from_visit); +CREATE INDEX visits_time_index ON visits (visit_time); +CREATE INDEX segments_name ON segments(name); +CREATE INDEX segments_url_id ON segments(url_id); +CREATE INDEX segment_usage_time_slot_segment_id ON segment_usage(time_slot, segment_id); +CREATE INDEX segments_usage_seg_id ON segment_usage(segment_id); +CREATE INDEX urls_url_index ON urls (url); +CREATE INDEX keyword_search_terms_index1 ON keyword_search_terms (keyword_id, lower_term); +CREATE INDEX keyword_search_terms_index2 ON keyword_search_terms (url_id); +CREATE INDEX keyword_search_terms_index3 ON keyword_search_terms (term); +COMMIT; diff --git a/components/test/data/history/history.28.sql b/components/test/data/history/history.28.sql new file mode 100644 index 0000000..d1356d4 --- /dev/null +++ b/components/test/data/history/history.28.sql @@ -0,0 +1,25 @@ +PRAGMA foreign_keys=OFF; +BEGIN TRANSACTION; +CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); +INSERT INTO "meta" VALUES('version','28'); +INSERT INTO "meta" VALUES('last_compatible_version','16'); +CREATE TABLE urls(id INTEGER PRIMARY KEY,url LONGVARCHAR,title LONGVARCHAR,visit_count INTEGER DEFAULT 0 NOT NULL,typed_count INTEGER DEFAULT 0 NOT NULL,last_visit_time INTEGER NOT NULL,hidden INTEGER DEFAULT 0 NOT NULL,favicon_id INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE visits(id INTEGER PRIMARY KEY,url INTEGER NOT NULL,visit_time INTEGER NOT NULL,from_visit INTEGER,transition INTEGER DEFAULT 0 NOT NULL,segment_id INTEGER,visit_duration INTEGER DEFAULT 0 NOT NULL); +CREATE TABLE visit_source(id INTEGER PRIMARY KEY,source INTEGER NOT NULL); +CREATE TABLE keyword_search_terms (keyword_id INTEGER NOT NULL,url_id INTEGER NOT NULL,lower_term LONGVARCHAR NOT NULL,term LONGVARCHAR NOT NULL); +CREATE TABLE downloads (id INTEGER PRIMARY KEY,current_path LONGVARCHAR NOT NULL,target_path LONGVARCHAR NOT NULL,start_time INTEGER NOT NULL,received_bytes INTEGER NOT NULL,total_bytes INTEGER NOT NULL,state INTEGER NOT NULL,danger_type INTEGER NOT NULL, interrupt_reason INTEGER NOT NULL,end_time INTEGER NOT NULL,opened INTEGER NOT NULL,referrer VARCHAR NOT NULL,by_ext_id VARCHAR NOT NULL,by_ext_name VARCHAR NOT NULL,etag VARCHAR NOT NULL,last_modified VARCHAR NOT NULL); +CREATE TABLE downloads_url_chains (id INTEGER NOT NULL,chain_index INTEGER NOT NULL,url LONGVARCHAR NOT NULL, PRIMARY KEY (id, chain_index) ); +CREATE TABLE segments (id INTEGER PRIMARY KEY,name VARCHAR,url_id INTEGER NON NULL); +CREATE TABLE segment_usage (id INTEGER PRIMARY KEY,segment_id INTEGER NOT NULL,time_slot INTEGER NOT NULL,visit_count INTEGER DEFAULT 0 NOT NULL); +CREATE INDEX visits_url_index ON visits (url); +CREATE INDEX visits_from_index ON visits (from_visit); +CREATE INDEX visits_time_index ON visits (visit_time); +CREATE INDEX segments_name ON segments(name); +CREATE INDEX segments_url_id ON segments(url_id); +CREATE INDEX segment_usage_time_slot_segment_id ON segment_usage(time_slot, segment_id); +CREATE INDEX segments_usage_seg_id ON segment_usage(segment_id); +CREATE INDEX urls_url_index ON urls (url); +CREATE INDEX keyword_search_terms_index1 ON keyword_search_terms (keyword_id, lower_term); +CREATE INDEX keyword_search_terms_index2 ON keyword_search_terms (url_id); +CREATE INDEX keyword_search_terms_index3 ON keyword_search_terms (term); +COMMIT; |