EXPECT_EQ(EC::container->RequestEdit("Editor"), 0);
}
-TEST_F(EC, AddDesignElement)
-{
- GList* candidatelist = NULL;
- bundle* data = bundle_create();;
- editable_geo geo = {0, 0, 100, 100};
-
- candidatelist = g_list_append(candidatelist, data);
-
- EXPECT_EQ(editable_add_design_element(EC::container, 0, 0, candidatelist, geo, "sample_editor"), 0);
-
- bundle_free(data);
- g_list_free(candidatelist);
-}
-
-TEST_F(EC, AddComplication)
-{
- complication_h complication;
- editable_geo geo = {0, 0, 100, 100};
-
- complication_create(0, "org.tizen.sample", COMPLICATION_SHORT_TEXT,
- COMPLICATION_SHORT_TEXT, COMPLICATION_SHAPE_CIRCLE,
- &complication);
- EXPECT_EQ(editable_add_complication(EC::container, 0, complication, geo, "sample_editor"), 0);
-
- complication_destroy(complication);
-}
-
-int on_editable_update_cb(const editable_h handle,
- int selected_idx,
- const editable_edit_state state,
- void *user_data) {
- return 0;
-}
-
-TEST_F(EC, RequestEdit_c)
-{
- int len = 0;
- bundle* data;
- bundle_raw* raw_data;
-
- Bundle* candidate1 = new Bundle();
- Bundle* candidate2 = new Bundle();
- std::unique_ptr<const char*[]> array(new const char*[2]);
-
- data = bundle_create();
- bundle_add_str(data, "GEO_X", std::to_string(0).c_str());
- bundle_add_str(data, "GEO_Y", std::to_string(0).c_str());
- bundle_add_str(data, "GEO_W", std::to_string(100).c_str());
- bundle_add_str(data, "GEO_H", std::to_string(100).c_str());
- bundle_add_str(data, "SHAPE_TYPE", std::to_string(IEditable::EditableShapeType::Circle).c_str());
- bundle_add_str(data, "CUR_DATA_IDX", std::to_string(0).c_str());
- bundle_add_str(data, "NAME", "sample");
- bundle_add_str(data, "EDITABLE_ID", std::to_string(0).c_str());
- bundle_encode(data, &raw_data, &len);
-
- array.get()[0] = candidate1->ToString();
- array.get()[1] = candidate2->ToString();
-
- bundle_add_str_array(data, "CANDIDATES_LIST", array.get(), 2);
-
- ReceivedEditable* re = new ReceivedEditable(std::string(reinterpret_cast<char*>(raw_data)), "sample_provider");
- std::shared_ptr<IEditable> ed = static_cast<std::shared_ptr<IEditable>>(re);
-
- EXPECT_EQ(EC::container->Add(ed), 0);
-
- EXPECT_EQ(editable_request_edit(EC::container, "sample_provider", on_editable_update_cb, NULL), 0);
-}
-
int on_edit_ready_cb(editable_container_h handle, const char *editor_appid, void *user_data) {
+ /* to do
+ editable_add_design_element
+ editable_add_complication
+ editable_request_edit
+ */
return 0;
}