Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests
  • Loading branch information
robert-ancell committed Oct 23, 2024
commit a6b2fbacd0e5c79b80971e0318af43c86c2b7461
12 changes: 12 additions & 0 deletions shell/platform/linux/fl_view_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ TEST(FlViewTest, SecondaryView) {
return kSuccess;
}));

g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));

FlView* secondary_view = fl_view_new_for_engine(engine);
EXPECT_EQ(view_id, fl_view_get_id(secondary_view));
}
Expand All @@ -103,6 +106,9 @@ TEST(FlViewTest, SecondaryViewError) {
return kInvalidArguments;
}));

g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));

FlView* secondary_view = fl_view_new_for_engine(engine);
EXPECT_EQ(view_id, fl_view_get_id(secondary_view));
}
Expand All @@ -125,6 +131,9 @@ TEST(FlViewTest, ViewDestroy) {
return kSuccess;
}));

g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));

FlView* secondary_view = fl_view_new_for_engine(engine);

int64_t implicit_view_id = fl_view_get_id(implicit_view);
Expand Down Expand Up @@ -155,6 +164,9 @@ TEST(FlViewTest, ViewDestroyError) {
return kInvalidArguments;
}));

g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));

FlView* secondary_view = fl_view_new_for_engine(engine);

gtk_widget_destroy(GTK_WIDGET(secondary_view));
Expand Down
15 changes: 15 additions & 0 deletions shell/platform/linux/testing/mock_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,18 @@ MockWindow::MockWindow() {
GdkWindowState gdk_window_get_state(GdkWindow* window) {
return mock->gdk_window_get_state(window);
}

GdkDisplay* gdk_window_get_display(GdkWindow* window) {
return nullptr;
}

GdkMonitor* gdk_display_get_monitor_at_window(GdkDisplay* display,
GdkWindow* window) {
return nullptr;
}

GdkCursor* gdk_cursor_new_from_name(GdkDisplay* display, const gchar* name) {
return nullptr;
}

void gdk_window_set_cursor(GdkWindow* window, GdkCursor* cursor) {}