Lines Matching refs:shell

16 #include "content/shell/browser/shell.h"
25 void RunScriptAndCheckResult(Shell* shell,
30 shell->web_contents(),
36 void Navigate(Shell* shell) {
37 NavigateToURL(shell, GetTestUrl("", "simple_database.html"));
40 void CreateTable(Shell* shell) {
41 RunScriptAndCheckResult(shell, "createTable()", "done");
44 void InsertRecord(Shell* shell, const std::string& data) {
45 RunScriptAndCheckResult(shell, "insertRecord('" + data + "')", "done");
48 void UpdateRecord(Shell* shell, int index, const std::string& data) {
50 shell,
55 void DeleteRecord(Shell* shell, int index) {
57 shell, "deleteRecord(" + base::IntToString(index) + ")", "done");
60 void CompareRecords(Shell* shell, const std::string& expected) {
61 RunScriptAndCheckResult(shell, "getRecords()", expected);
64 bool HasTable(Shell* shell) {
67 shell->web_contents(),
76 Navigate(shell());
77 CreateTable(shell());
78 InsertRecord(shell(), "text");
79 CompareRecords(shell(), "text");
80 InsertRecord(shell(), "text2");
81 CompareRecords(shell(), "text, text2");
86 Navigate(shell());
87 CreateTable(shell());
88 InsertRecord(shell(), "text");
89 UpdateRecord(shell(), 0, "0");
90 CompareRecords(shell(), "0");
92 InsertRecord(shell(), "1");
93 InsertRecord(shell(), "2");
94 UpdateRecord(shell(), 1, "1000");
95 CompareRecords(shell(), "0, 1000, 2");
100 Navigate(shell());
101 CreateTable(shell());
102 InsertRecord(shell(), "text");
103 DeleteRecord(shell(), 0);
104 CompareRecords(shell(), std::string());
106 InsertRecord(shell(), "0");
107 InsertRecord(shell(), "1");
108 InsertRecord(shell(), "2");
109 DeleteRecord(shell(), 1);
110 CompareRecords(shell(), "0, 2");
115 Navigate(shell());
116 CreateTable(shell());
117 InsertRecord(shell(), "text");
120 shell(), "deleteRecord(1)", "could not find row with index: 1");
122 CompareRecords(shell(), "text");
127 Navigate(shell());
128 CreateTable(shell());
133 InsertRecord(shell(), item);
138 CompareRecords(shell(), expected);
143 UpdateRecord(shell(), i, item);
148 CompareRecords(shell(), expected);
151 DeleteRecord(shell(), 0);
153 CompareRecords(shell(), std::string());
156 shell(), "deleteRecord(1)", "could not find row with index: 1");
158 CompareRecords(shell(), std::string());
163 Navigate(shell());
164 CreateTable(shell());
165 InsertRecord(shell(), "text");
170 shell()->Reload();
173 CompareRecords(shell(), "text");
179 Navigate(shell());
180 CreateTable(shell());
181 InsertRecord(shell(), "text");
199 Navigate(shell());
200 ASSERT_FALSE(HasTable(shell()));
201 CreateTable(shell());
202 CompareRecords(shell(), std::string());
207 Navigate(shell());
208 CreateTable(shell());
209 InsertRecord(shell(), "text");
215 CompareRecords(shell(), "0");
221 Navigate(shell());
222 CreateTable(shell());
223 InsertRecord(shell(), "text");
227 Navigate(shell());
228 CompareRecords(shell(), "text");
247 Navigate(shell());
248 CreateTable(shell());
249 InsertRecord(shell(), "1");
251 CrashTab(shell()->web_contents());
252 Navigate(shell());
253 CompareRecords(shell(), "1");