Lines Matching refs:shell
14 #include "content/shell/browser/shell.h"
26 void RunScriptAndCheckResult(Shell* shell,
31 shell->web_contents(),
37 void Navigate(Shell* shell) {
38 NavigateToURL(shell, GetTestUrl("", "simple_database.html"));
41 void CreateTable(Shell* shell) {
42 RunScriptAndCheckResult(shell, "createTable()", "done");
45 void InsertRecord(Shell* shell, const std::string& data) {
46 RunScriptAndCheckResult(shell, "insertRecord('" + data + "')", "done");
49 void UpdateRecord(Shell* shell, int index, const std::string& data) {
51 shell,
56 void DeleteRecord(Shell* shell, int index) {
58 shell, "deleteRecord(" + base::IntToString(index) + ")", "done");
61 void CompareRecords(Shell* shell, const std::string& expected) {
62 RunScriptAndCheckResult(shell, "getRecords()", expected);
65 bool HasTable(Shell* shell) {
68 shell->web_contents(),
77 Navigate(shell());
78 CreateTable(shell());
79 InsertRecord(shell(), "text");
80 CompareRecords(shell(), "text");
81 InsertRecord(shell(), "text2");
82 CompareRecords(shell(), "text, text2");
87 Navigate(shell());
88 CreateTable(shell());
89 InsertRecord(shell(), "text");
90 UpdateRecord(shell(), 0, "0");
91 CompareRecords(shell(), "0");
93 InsertRecord(shell(), "1");
94 InsertRecord(shell(), "2");
95 UpdateRecord(shell(), 1, "1000");
96 CompareRecords(shell(), "0, 1000, 2");
101 Navigate(shell());
102 CreateTable(shell());
103 InsertRecord(shell(), "text");
104 DeleteRecord(shell(), 0);
105 CompareRecords(shell(), std::string());
107 InsertRecord(shell(), "0");
108 InsertRecord(shell(), "1");
109 InsertRecord(shell(), "2");
110 DeleteRecord(shell(), 1);
111 CompareRecords(shell(), "0, 2");
116 Navigate(shell());
117 CreateTable(shell());
118 InsertRecord(shell(), "text");
121 shell(), "deleteRecord(1)", "could not find row with index: 1");
123 CompareRecords(shell(), "text");
128 Navigate(shell());
129 CreateTable(shell());
134 InsertRecord(shell(), item);
139 CompareRecords(shell(), expected);
144 UpdateRecord(shell(), i, item);
149 CompareRecords(shell(), expected);
152 DeleteRecord(shell(), 0);
154 CompareRecords(shell(), std::string());
157 shell(), "deleteRecord(1)", "could not find row with index: 1");
159 CompareRecords(shell(), std::string());
164 Navigate(shell());
165 CreateTable(shell());
166 InsertRecord(shell(), "text");
171 shell()->Reload();
174 CompareRecords(shell(), "text");
180 Navigate(shell());
181 CreateTable(shell());
182 InsertRecord(shell(), "text");
184 Shell* otr = CreateOffTheRecordBrowser();
195 Shell* otr = CreateOffTheRecordBrowser();
200 Navigate(shell());
201 ASSERT_FALSE(HasTable(shell()));
202 CreateTable(shell());
203 CompareRecords(shell(), std::string());
208 Navigate(shell());
209 CreateTable(shell());
210 InsertRecord(shell(), "text");
212 Shell* shell2 = CreateBrowser();
216 CompareRecords(shell(), "0");
222 Navigate(shell());
223 CreateTable(shell());
224 InsertRecord(shell(), "text");
228 Navigate(shell());
229 CompareRecords(shell(), "text");
234 Shell* otr = CreateOffTheRecordBrowser();
241 Shell* otr = CreateOffTheRecordBrowser();
248 Navigate(shell());
249 CreateTable(shell());
250 InsertRecord(shell(), "1");
252 CrashTab(shell()->web_contents());
253 Navigate(shell());
254 CompareRecords(shell(), "1");
260 Shell* otr1 = CreateOffTheRecordBrowser();
265 Shell* otr2 = CreateOffTheRecordBrowser();