geary/test/client/components/client-web-view-test.vala
Michael James Gratton 15748cef03 Tidy up unit test infrastructure and mock classes.
* test/api/*.vala: Renamed files that contained mock objects to *-mock.vala,
  not *-test.vala.

* test/testcase.vala: Renamed to test-case.vala for consistency, remove
  TestCase class from Gee package since that's really not true. Clean up
  code for consistency.

* test/meson.build, test/CMakeLists.txt: Split TestCase compilation out
  into a separate test lib.
2018-04-07 09:41:18 +10:00

34 lines
975 B
Vala

/*
* Copyright 2016 Michael Gratton <mike@vee.net>
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
public class ClientWebViewTest : TestCase {
public ClientWebViewTest() {
base("ClientWebViewTest");
add_test("init_web_context", init_web_context);
add_test("load_resources", load_resources);
}
public void init_web_context() throws Error {
Configuration config = new Configuration(GearyApplication.APP_ID);
ClientWebView.init_web_context(
config,
File.new_for_path(_BUILD_ROOT_DIR).get_child("src"),
File.new_for_path("/tmp"), // XXX use something better here
true
);
}
public void load_resources() throws Error {
try {
ClientWebView.load_scripts();
} catch (Error err) {
assert_not_reached();
}
}
}